ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ConTeXt-defined colours broken in TikZ in MkIV with latest betas
@ 2015-04-13 17:45 Mojca Miklavec
  2015-04-13 18:13 ` Christian Prim
  2015-04-13 20:51 ` Hans Hagen
  0 siblings, 2 replies; 13+ messages in thread
From: Mojca Miklavec @ 2015-04-13 17:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Christian Feuersaenger

Hi,

The following example works in MkII and it works in TeX Live 2014, but
it fails with the latest beta (it draws a black rectangle instead of
using the defined colour):

\usemodule[tikz]
\starttext
\definecolor[mycol][r=0.9,g=0.8,b=0.8]
\starttikzpicture
\fill[mycol] (0, 0) rectangle (2,4);
\stoptikzpicture
\stoptext

It would be really nice to fix this in time for TeX Live 2015.

Thank you,
    Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-13 17:45 ConTeXt-defined colours broken in TikZ in MkIV with latest betas Mojca Miklavec
@ 2015-04-13 18:13 ` Christian Prim
  2015-04-13 20:51 ` Hans Hagen
  1 sibling, 0 replies; 13+ messages in thread
From: Christian Prim @ 2015-04-13 18:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1172 bytes --]

Hi

I can confirm this bug. It worked fine for me a week before. It seems to be
a bug in one of the latest beta.

Thanks for fixing it
Christian

2015-04-13 19:45 GMT+02:00 Mojca Miklavec <mojca.miklavec.lists@gmail.com>:

> Hi,
>
> The following example works in MkII and it works in TeX Live 2014, but
> it fails with the latest beta (it draws a black rectangle instead of
> using the defined colour):
>
> \usemodule[tikz]
> \starttext
> \definecolor[mycol][r=0.9,g=0.8,b=0.8]
> \starttikzpicture
> \fill[mycol] (0, 0) rectangle (2,4);
> \stoptikzpicture
> \stoptext
>
> It would be really nice to fix this in time for TeX Live 2015.
>
> Thank you,
>     Mojca
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 2098 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-13 17:45 ConTeXt-defined colours broken in TikZ in MkIV with latest betas Mojca Miklavec
  2015-04-13 18:13 ` Christian Prim
@ 2015-04-13 20:51 ` Hans Hagen
  2015-04-14  8:29   ` Christian Prim
  1 sibling, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2015-04-13 20:51 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

On 4/13/2015 7:45 PM, Mojca Miklavec wrote:
> Hi,
>
> The following example works in MkII and it works in TeX Live 2014, but
> it fails with the latest beta (it draws a black rectangle instead of
> using the defined colour):
>
> \usemodule[tikz]
> \starttext
> \definecolor[mycol][r=0.9,g=0.8,b=0.8]
> \starttikzpicture
> \fill[mycol] (0, 0) rectangle (2,4);
> \stoptikzpicture
> \stoptext
>
> It would be really nice to fix this in time for TeX Live 2015.

Hm, i'm a bit puzzled why some suggested patched are nto in the 
distribution. Anyway, attached a more modern variant

you need a beta that i just uploaded because i found out that when tijz 
predefines some mixed colors it assumes rgb color space

your example then runs ok here

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

[-- Attachment #2: pgfutil-context.def --]
[-- Type: text/plain, Size: 9684 bytes --]

% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
%
% Adapted for colors and pdf resources by Hans Hagen. There can be a few more
% optimizations but they are not critital.

\pgfutil@format@is@contexttrue

% an aux files, needed for reading back coordinates

\def\pgfutil@aux@read@hook{%
  \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
  \csname newwrite\endcsname\pgfutil@auxout
  \csname openout\endcsname\pgfutil@auxout\jobname.pgf\relax
}

% no need for x colors (users can load it if needed)

\def\pgfutil@color#1{%
  \pgfutil@colorlet{.}{#1}%
  \pgfsysprotocol@getcurrentprotocol\pgfutil@emu@temp%
  {%
    \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
    \pgfsysprotocol@bufferedtrue%
    \pgfsetcolor{.}%
    \expandafter\pgfsys@outerinvoke\expandafter{\pgfsysprotocol@currentprotocol}%
  }%
  \pgfsysprotocol@setcurrentprotocol\pgfutil@emu@temp%
  \aftergroup\pgfutil@reset@color%
}

\def\pgfutil@extractcolorspec#1#2{%
  \def#2{{#1}}%
}

\def\pgfutil@convertcolorspec#1#2#3{%
  \edef#3{\expandafter\expandafter\expandafter\pgfutil@emu@select\csname\string\color@#1\endcsname}%
}

\def\pgfutil@doifcolorelse#1#2#3{%
  \expandafter\ifx\csname\string\color@#1\endcsname\relax%
    \doifcolorelse{#1}{\let\pgf@next=\pgfutil@firstoftwo}{\let\pgf@next=\pgfutil@secondoftwo}%
  \else
    \let\pgf@next=\pgfutil@firstoftwo%
  \fi%
  \pgf@next{#2}{#3}%
}

\def\pgfutil@reset@color{%
  \pgfsysprotocol@getcurrentprotocol\pgfutil@emu@temp%
  {%
    \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
    \pgfsysprotocol@bufferedtrue%
    \pgfsetcolor{.}%
    \expandafter\pgfsys@outerinvoke\expandafter{\pgfsysprotocol@currentprotocol}%
  }%
  \pgfsysprotocol@setcurrentprotocol\pgfutil@emu@temp%
}

\expandafter\def\csname\string\color@.\endcsname{\xcolor@{}{}{rgb}{0,0,0}}

\def\pgfutil@colorlet#1#2{%
  \edef\pgf@marshal{#2}%
  \expandafter\pgfutil@in@\expandafter!\expandafter{\pgf@marshal}%
  \ifpgfutil@in@%
    % compute mixture
    {%
      \expandafter\pgfutil@emu@mix\pgf@marshal!white!\@nil%
      \xdef\pgf@marshal{\noexpand\def\expandafter\noexpand\csname\string\color@#1\endcsname{%
          \noexpand\xcolor@{}{}{rgb}{\pgf@sys@tonumber\pgf@xa,\pgf@sys@tonumber\pgf@xb,\pgf@sys@tonumber\pgf@xc}}}%
    }%
    \pgf@marshal%
  \else%
    \expandafter\ifx\csname\string\color@#2\endcsname\relax%
      \pgfutil@registerrgb{#2}%
    \fi%
    \edef\pgf@marshal{\noexpand\let\expandafter\noexpand\csname\string\color@#1\endcsname=%
                      \expandafter\noexpand\csname\string\color@#2\endcsname}%
    \pgf@marshal%
  \fi%
}

\def\pgfutil@emu@mix#1!#2!#3!#4\@nil{%
  \expandafter\ifx\csname\string\color@#1\endcsname\relax%
    \pgfutil@registerrgb{#1}%
  \fi%
  \expandafter\ifx\csname\string\color@#3\endcsname\relax%
    \pgfutil@registerrgb{#3}%
  \fi%
  \expandafter\expandafter\expandafter\pgfutil@emu@unpack\csname\string\color@#1\endcsname%
  \pgf@ya=\pgf@xa%
  \pgf@yb=\pgf@xb%
  \pgf@yc=\pgf@xc%
  \expandafter\expandafter\expandafter\pgfutil@emu@unpack\csname\string\color@#3\endcsname%
  \c@pgf@counta=#2\relax%
  \c@pgf@countb=100\relax%
  \advance\c@pgf@countb by-\c@pgf@counta\relax%
  \pgf@xa=\c@pgf@countb\pgf@xa%
  \advance\pgf@xa by\c@pgf@counta\pgf@ya%
  \divide\pgf@xa by 100\relax%
  \pgf@xb=\c@pgf@countb\pgf@xb%
  \advance\pgf@xb by\c@pgf@counta\pgf@yb%
  \divide\pgf@xb by 100\relax%
  \pgf@xc=\c@pgf@countb\pgf@xc%
  \advance\pgf@xc by\c@pgf@counta\pgf@yc%
  \divide\pgf@xc by 100\relax%
}

\def\pgfutil@emu@unpack#1#2#3#4#5{%
  \pgfutil@emu@@unpack#5\@nil%
}

\def\pgfutil@emu@@unpack#1,#2,#3\@nil{%
  \pgf@xa=#1pt%
  \pgf@xb=#2pt%
  \pgf@xc=#3pt%
}

\def\pgfutil@emu@select#1#2#3#4#5{#5}

% goody

\let\colorlet=\pgfutil@colorlet

% latex stuff

\newskip\pgfutil@flushglue
\pgfutil@flushglue=0pt plus 1fil

\def\AtBeginDocument#1{#1}%

% pgfutil@minipage

\def\pgfutil@minipage[#1]#2{%
  \hbox to#2\bgroup
    \hsize=#2\relax
    \vbox\bgroup\leavevmode
}

\def\pgfutil@endminipage{%
  \egroup
  \egroup
}

% global colors

\let\pgfutil@globalcolorsfalse\relax
\let\pgfutil@globalcolorstrue \relax

% font stuff

\def\pgfutil@font@tiny        {\tfxx}
\def\pgfutil@font@scriptsize  {\tfxx}
\def\pgfutil@font@footnotesize{\tfx}
\def\pgfutil@font@small       {\tfx}
\def\pgfutil@font@normalsize  {\tf}
\def\pgfutil@font@large       {\tfa}
\def\pgfutil@font@Large       {\tfb}
\def\pgfutil@font@huge        {\tfc}
\def\pgfutil@font@Huge        {\tfc}
\def\pgfutil@font@itshape     {\it}
\def\pgfutil@font@bfseries    {\bf}
\def\pgfutil@font@normalfont  {\tf}
\def\pgfutil@selectfont       {\tf}

% registers

\newcount\pgfutil@tempcnta
\newcount\pgfutil@tempcntb

\newbox  \pgfutil@tempboxa

\newbox  \pgfutil@voidb@x
\newtoks \pgfutil@toks@

\let\pgfmath@tempdima\pgfutil@tempdima
\let\pgfmath@tempdima\pgfutil@tempdima
\let\pgfmath@tempcnta\pgfutil@tempcnta
\let\pgfmath@tempcntb\pgfutil@tempcntb

% module stuff

\def\pgfutil@usemodule#1{\usemodule[#1]}

% more adaptions

\let\pgfutil@insertatbegincurrentpagefrombox\flushatshipout
\let\pgfutil@insertatbegincurrentpage       \flushatshipout
\def\pgfutil@insertatbegineverypage         #1{\appendtoks#1\to\everyshipout} % space removed after #1

\let\pgfutil@setuppdfresources \relax

\doifmodeelse {mkiv} {

    \def\pgfsysdriver{pgfsys-pdftex.def}

    \def\pgfutil@driver@if@in#1#2{%
        \edef\pgf@marshal{\noexpand\pgfutil@in@{#1}{\preloadedspecials}}%
        \pgf@marshal
        \ifpgfutil@in@
            \def\pgfsysdriver{#2}%
        \fi
    }

    \def\pgf@sys@pdf@pdfbackendset@one#1#2%
      {\normalexpanded{\noexpand\pgf@sys@pdf@pdfbackendset@two\noexpand#1#2\relax}}

    \def\pgf@sys@pdf@pdfbackendset@two#1/#2 #3\relax
      {#1{#2}{#3}}

    \def\pgf@sys@pdf@addtopageresource@pattern   {\pgf@sys@pdf@pdfbackendset@one\pdfbackendsetpattern}
    \def\pgf@sys@pdf@addtopageresource@colorspace{\pgf@sys@pdf@pdfbackendset@one\pdfbackendsetcolorspace}
    \def\pgf@sys@pdf@addtopageresource@extgstate {\pgf@sys@pdf@pdfbackendset@one\pdfbackendsetextgstate}
    \def\pgf@sys@pdf@possible@resources          {\pdfbackendcurrentresources}
    \def\pgf@sys@pdf@check@resources             {}

    \let\pgfutil@registercolor\pgf@context@registercolor
    \let\pgfutil@registerrgb  \pgf@context@registerrgb
    \let\pgfutil@registercmyk \pgf@context@registercmyk
    \let\pgfutil@registergray \pgf@context@registergray

} {


    \ifx\pdfoutput\undefined\newcount\pdfoutput\fi
    \ifx\pdfoutput\relax    \newcount\pdfoutput\fi

    \def\pgfutil@guessdriver{
      \ifx\XeTeXversion\@undefined
        \ifx\preloadedspecials\@undefined%
          \ifcase\pdfoutput%
            \def\pgfsysdriver{pgfsys-dvips.def}%
          \else%
            \def\pgfsysdriver{pgfsys-pdftex.def}% pdfTeX & LuaTeX
          \fi%
        \else%
          \pgfutil@driver@if@in{postscript}{pgfsys-dvips.def}
          \pgfutil@driver@if@in{tpd}{pgfsys-pdftex.def}
          \pgfutil@driver@if@in{dpm}{pgfsys-dvipdfm.def}
          \pgfutil@driver@if@in{dpx}{pgfsys-dvipdfmx.def}
          \pgfutil@driver@if@in{xetex}{pgfsys-xetex.def}
          \ifx\pgfsysdriver\relax%
            \PackageWarning{pgf}{I was not able to discern the driver, the
              preloaded specials were \preloadedspecials. I am going to use
              pgfsys-dvips.def}%
            \def\pgfsysdriver{pgfsys-dvips.def}
          \fi%
        \fi
      \else
        \def\pgfsysdriver{pgfsys-xetex.def}% should be right
      \fi
    }

    \def\pgfutil@driver@if@in#1#2{%
      \edef\pgf@marshal{\noexpand\pgfutil@in@{#1}{\preloadedspecials}}%
      \pgf@marshal
      \ifpgfutil@in@
        \def\pgfsysdriver{#2}%
      \fi
    }

    \def\pgfutil@registercolor#1{%
      \edef\pgf@temp{\PDFcolor{#1}}%
      \edef\pgf@marshal{\noexpand\pgfutil@in@{ g}{\pgf@temp}}%
      \pgf@marshal
      \ifpgfutil@in@
        \expandafter\pgfutil@context@parse@gray\pgf@temp\pgf@stop{#1}%
      \else
        \edef\pgf@marshal{\noexpand\pgfutil@in@{ rg}{\pgf@temp}}%
        \pgf@marshal
        \ifpgfutil@in@
          \expandafter\pgfutil@context@parse@rgb\pgf@temp\pgf@stop{#1}%
        \else
          \PackageError{pgf}{Color #1 has an unsupported color model.}{}%
          \pgfutil@definecolor{#1}{gray}{0}%
        \fi
      \fi
    }

    \def\pgfutil@context@parse@gray#1 g#2\pgf@stop#3{%
      \pgfutil@definecolor{#3}{gray}{#1}%
    }

    \def\pgfutil@context@parse@rgb#1 #2 #3 rg#4\pgf@stop#5{%
      \pgfutil@definecolor{#5}{rgb}{#1,#2,#3}%
    }

    \let\pgfutil@registerrgb  \pgfutil@registercolor
    \let\pgfutil@registercmyk \pgfutil@registercolor
    \let\pgfutil@registergray \pgfutil@registercolor

    \def\pgf@sys@pdf@addtopageresource@extgstate  {\appendtoPDFdocumentextgstates }
    \def\pgf@sys@pdf@addtopageresource@colorspace {\appendtoPDFdocumentcolorspaces}
    \def\pgf@sys@pdf@addtopageresource@pattern    {\appendtoPDFdocumentpatterns   }
    \def\pgf@sys@pdf@possible@resources           {\currentPDFresources}
    \def\pgf@sys@pdf@check@resources              {}

}

\let\pgf@sys@addpdfresource@extgs@plain      \pgf@sys@pdf@addtopageresource@extgstate
\let\pgf@sys@addpdfresource@patterns@plain   \pgf@sys@pdf@addtopageresource@pattern
\let\pgf@sys@addpdfresource@colorspaces@plain\pgf@sys@pdf@addtopageresource@colorspace
\let\pgf@sys@pdf@check@resources@plain       \pgf@sys@pdf@check@resources

\pgf@sys@addpdfresource@colorspaces@plain{/pgfprgb [/Pattern /DeviceRGB]}

% do something at the end of a job

\appendtoks \the\pgfutil@everybye \to \everybye

\endinput

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-13 20:51 ` Hans Hagen
@ 2015-04-14  8:29   ` Christian Prim
  2015-04-14  8:42     ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Prim @ 2015-04-14  8:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2485 bytes --]

Thanks Hans for the fix!

I have noticed, that spotcolors can be used in tikz, but they are darker.
Is that wanted or a bug?

MWE:

\usemodule[tikz]
\starttext
\definecolor[gruen][c=0.52,y=0.86]
\definespotcolor[mycol][gruen][p=1]
\definespotcolor[mycol_h][gruen][p=0.5]
\definespotcolor[mycol_q][gruen][p=0.25]
\startcolor[mycol]
{\bfa Test Test Test Test Test}
\stopcolor

\starttikzpicture
\fill[mycol] (0, 0) rectangle (2,4);
\fill[mycol_h] (2, 0) rectangle ++(2,4);
\fill[mycol_q] (4, 0) rectangle ++(2,4);
\stoptikzpicture
\stoptext


I expect the first rectangle to have the same color as the (wanted) color
of the text. But the color of the text is closer to the color of the
rectangle in the middle (50%).

Christian

2015-04-13 22:51 GMT+02:00 Hans Hagen <pragma@wxs.nl>:

> On 4/13/2015 7:45 PM, Mojca Miklavec wrote:
>
>> Hi,
>>
>> The following example works in MkII and it works in TeX Live 2014, but
>> it fails with the latest beta (it draws a black rectangle instead of
>> using the defined colour):
>>
>> \usemodule[tikz]
>> \starttext
>> \definecolor[mycol][r=0.9,g=0.8,b=0.8]
>> \starttikzpicture
>> \fill[mycol] (0, 0) rectangle (2,4);
>> \stoptikzpicture
>> \stoptext
>>
>> It would be really nice to fix this in time for TeX Live 2015.
>>
>
> Hm, i'm a bit puzzled why some suggested patched are nto in the
> distribution. Anyway, attached a more modern variant
>
> you need a beta that i just uploaded because i found out that when tijz
> predefines some mixed colors it assumes rgb color space
>
> your example then runs ok here
>
> Hans
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 4670 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-14  8:29   ` Christian Prim
@ 2015-04-14  8:42     ` Hans Hagen
  2015-04-14  9:54       ` Christian Prim
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2015-04-14  8:42 UTC (permalink / raw)
  To: ntg-context

On 4/14/2015 10:29 AM, Christian Prim wrote:
> Thanks Hans for the fix!
>
> I have noticed, that spotcolors can be used in tikz, but they are
> darker. Is that wanted or a bug?

they will map onto cmyk or rgb depending on definitions ... don't expect 
advanced context color models to work with tikz (but they do work with 
metafun)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-14  8:42     ` Hans Hagen
@ 2015-04-14  9:54       ` Christian Prim
  2015-04-16 19:34         ` Christian Prim
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Prim @ 2015-04-14  9:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2312 bytes --]

Thanks Hans for clarification. But even with simple context color models
(that worked before) I get other colors.

MWE:

\usemodule[tikz]
\setupbodyfont[40pt]
\starttext
\definecolor[mycol][c=0.23,m=0.58,y=0.88,k=0.45]
\definecolor[mycol_h][c=0.115,m=0.29,y=0.44,k=0.225]
\definecolor[mycol_q][c=0.055,m=0.145,y=0.22,k=0.1125]
\startcolor[mycol]
{\bfa •••••••• Test}
\stopcolor

\starttikzpicture
\fill[mycol] (0, 0) rectangle (2,4);
\fill[mycol_h] (2, 0) rectangle ++(2,4);
\fill[mycol_q] (4, 0) rectangle ++(2,4);
\stoptikzpicture
\stoptext

I'm not so familiar with metafun, so I couldn't do the rectangle with
metafun (the different colors between context/metafun and tikz would
certainly be better visible so). But the bullet shows, that the text color
isn't the same as the tikz-figure. But they should as they are identical.
Something must have changed in color handling.

Christian

2015-04-14 10:42 GMT+02:00 Hans Hagen <pragma@wxs.nl>:

> On 4/14/2015 10:29 AM, Christian Prim wrote:
>
>> Thanks Hans for the fix!
>>
>> I have noticed, that spotcolors can be used in tikz, but they are
>> darker. Is that wanted or a bug?
>>
>
> they will map onto cmyk or rgb depending on definitions ... don't expect
> advanced context color models to work with tikz (but they do work with
> metafun)
>
>
> Hans
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
> ____________________________________________________________
> _______________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/
> listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 3845 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-14  9:54       ` Christian Prim
@ 2015-04-16 19:34         ` Christian Prim
  2015-04-16 19:58           ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Prim @ 2015-04-16 19:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2743 bytes --]

Hi Hans

is it correct, that with the new beta one can just use rgb-colors using
tikz or is there a bug preventing the usage of cmyk-colors as it used to
work before?

Thanks!

Christian

PS.: See mail below for MWE showing false cmyk colors in tikz.

2015-04-14 11:54 GMT+02:00 Christian Prim <christian.prim@gmx.ch>:

> Thanks Hans for clarification. But even with simple context color models
> (that worked before) I get other colors.
>
> MWE:
>
> \usemodule[tikz]
> \setupbodyfont[40pt]
> \starttext
> \definecolor[mycol][c=0.23,m=0.58,y=0.88,k=0.45]
> \definecolor[mycol_h][c=0.115,m=0.29,y=0.44,k=0.225]
> \definecolor[mycol_q][c=0.055,m=0.145,y=0.22,k=0.1125]
> \startcolor[mycol]
> {\bfa •••••••• Test}
> \stopcolor
>
> \starttikzpicture
> \fill[mycol] (0, 0) rectangle (2,4);
> \fill[mycol_h] (2, 0) rectangle ++(2,4);
> \fill[mycol_q] (4, 0) rectangle ++(2,4);
> \stoptikzpicture
> \stoptext
>
> I'm not so familiar with metafun, so I couldn't do the rectangle with
> metafun (the different colors between context/metafun and tikz would
> certainly be better visible so). But the bullet shows, that the text color
> isn't the same as the tikz-figure. But they should as they are identical.
> Something must have changed in color handling.
>
> Christian
>
> 2015-04-14 10:42 GMT+02:00 Hans Hagen <pragma@wxs.nl>:
>
>> On 4/14/2015 10:29 AM, Christian Prim wrote:
>>
>>> Thanks Hans for the fix!
>>>
>>> I have noticed, that spotcolors can be used in tikz, but they are
>>> darker. Is that wanted or a bug?
>>>
>>
>> they will map onto cmyk or rgb depending on definitions ... don't expect
>> advanced context color models to work with tikz (but they do work with
>> metafun)
>>
>>
>> Hans
>>
>> -----------------------------------------------------------------
>>                                           Hans Hagen | PRAGMA ADE
>>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>>                                              | www.pragma-pod.nl
>> -----------------------------------------------------------------
>> ____________________________________________________________
>> _______________________
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/
>> listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ____________________________________________________________
>> _______________________
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 4644 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-16 19:34         ` Christian Prim
@ 2015-04-16 19:58           ` Hans Hagen
  2015-04-16 21:29             ` Christian Prim
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2015-04-16 19:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/16/2015 9:34 PM, Christian Prim wrote:
> Hi Hans
>
> is it correct, that with the new beta one can just use rgb-colors using
> tikz or is there a bug preventing the usage of cmyk-colors as it used to
> work before?

cmyk should work ok but afaik tikz assumes rgb in some cases so that 
prohibits that we can do automatic conversion tp other color spaces at 
he context end

> Thanks!
>
> Christian
>
> PS.: See mail below for MWE showing false cmyk colors in tikz.
>
> 2015-04-14 11:54 GMT+02:00 Christian Prim <christian.prim@gmx.ch
> <mailto:christian.prim@gmx.ch>>:
>
>     Thanks Hans for clarification. But even with simple context color
>     models (that worked before) I get other colors.
>
>     MWE:
>
>     \usemodule[tikz]
>     \setupbodyfont[40pt]
>     \starttext
>     \definecolor[mycol][c=0.23,m=0.58,y=0.88,k=0.45]
>     \definecolor[mycol_h][c=0.115,m=0.29,y=0.44,k=0.225]
>     \definecolor[mycol_q][c=0.055,m=0.145,y=0.22,k=0.1125]
>     \startcolor[mycol]
>     {\bfa •••••••• Test}
>     \stopcolor
>
>     \starttikzpicture
>     \fill[mycol] (0, 0) rectangle (2,4);
>     \fill[mycol_h] (2, 0) rectangle ++(2,4);
>     \fill[mycol_q] (4, 0) rectangle ++(2,4);
>     \stoptikzpicture
>     \stoptext
>
>     I'm not so familiar with metafun, so I couldn't do the rectangle
>     with metafun (the different colors between context/metafun and tikz
>     would certainly be better visible so). But the bullet shows, that
>     the text color isn't the same as the tikz-figure. But they should as
>     they are identical. Something must have changed in color handling.
>
>     Christian
>
>     2015-04-14 10:42 GMT+02:00 Hans Hagen <pragma@wxs.nl
>     <mailto:pragma@wxs.nl>>:
>
>         On 4/14/2015 10:29 AM, Christian Prim wrote:
>
>             Thanks Hans for the fix!
>
>             I have noticed, that spotcolors can be used in tikz, but
>             they are
>             darker. Is that wanted or a bug?
>
>
>         they will map onto cmyk or rgb depending on definitions ...
>         don't expect advanced context color models to work with tikz
>         (but they do work with metafun)
>
>
>         Hans
>
>         ------------------------------__------------------------------__-----
>                                                    Hans Hagen | PRAGMA ADE
>                        Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>              tel: 038 477 53 69 | voip: 087 875 68 74
>         <tel:087%20875%2068%2074> | www.pragma-ade.com
>         <http://www.pragma-ade.com>
>                                                       |
>         www.pragma-pod.nl <http://www.pragma-pod.nl>
>         ------------------------------__------------------------------__-----
>         _______________________________________________________________________________________
>         If your question is of interest to others as well, please add an
>         entry to the Wiki!
>
>         maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> /
>         http://www.ntg.nl/mailman/__listinfo/ntg-context
>         <http://www.ntg.nl/mailman/listinfo/ntg-context>
>         webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
>         archive  : http://foundry.supelec.fr/__projects/contextrev/
>         <http://foundry.supelec.fr/projects/contextrev/>
>         wiki     : http://contextgarden.net
>         _______________________________________________________________________________________
>
>
>
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-16 19:58           ` Hans Hagen
@ 2015-04-16 21:29             ` Christian Prim
  2015-04-16 23:27               ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Prim @ 2015-04-16 21:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 6757 bytes --]

Hi Hans

sorry to ask again. But the different color handling between
context-version before 2015.04.14 00:54 and
context-version 2015.04.14 00:54 is remarkable and annoying.

See attached pdf-documents. Both have exactly the same source:

\usemodule[tikz]
\setupbodyfont[40pt]
\starttext
\definecolor[mycola][c=0.23,m=0.58,y=0.88,k=0.45]
\definecolor[mycolb][c=0.115,m=0.29,y=0.44,k=0.225]
\definecolor[mycolc][c=0.055,m=0.145,y=0.22,k=0.1125]

\starttikzpicture
\node[fill=mycola,rectangle, minimum height=4cm,minimum 
width=2cm,anchor=south west] {\startcolor[mycola]T\stopcolor};
\node[fill=mycolb,rectangle, minimum height=4cm,minimum 
width=2cm,anchor=south west] at (2,0) {\startcolor[mycolb]T\stopcolor};
\node[fill=mycolc,rectangle, minimum height=4cm,minimum 
width=2cm,anchor=south west] at (4,0) {\startcolor[mycolc]T\stopcolor};
\stoptikzpicture
\stoptext

I write in each box the letter T with exactly the same color as the 
underlying box. Textcolor is set using context, fill color of the box 
is set using tikz.

old.pdf shows the correct color handling. The letter T has exactly the 
same color as the box and therefore disappears.

With newest beta (new.pdf) the letter T is visible.

Must I now stay with an old beta or can this "bug" be fixed? Perhaps 
it's a bug in tikz...

Thanks
Christian


Am Don, 16. Apr, 2015 um 9:58 schrieb Hans Hagen <pragma@wxs.nl>:
> On 4/16/2015 9:34 PM, Christian Prim wrote:
> > Hi Hans
> >
> > is it correct, that with the new beta one can just use rgb-colors 
> using
> > tikz or is there a bug preventing the usage of cmyk-colors as it 
> used to
> > work before?
> 
> cmyk should work ok but afaik tikz assumes rgb in some cases so that
> prohibits that we can do automatic conversion tp other color spaces at
> he context end
> 
> > Thanks!
> >
> > Christian
> >
> > PS.: See mail below for MWE showing false cmyk colors in tikz.
> >
> > 2015-04-14 11:54 GMT+02:00 Christian Prim <christian.prim@gmx.ch
> > <mailto:christian.prim@gmx.ch>>:
> >
> >     Thanks Hans for clarification. But even with simple context 
> color
> >     models (that worked before) I get other colors.
> >
> >     MWE:
> >
> >     \usemodule[tikz]
> >     \setupbodyfont[40pt]
> >     \starttext
> >     \definecolor[mycol][c=0.23,m=0.58,y=0.88,k=0.45]
> >     \definecolor[mycol_h][c=0.115,m=0.29,y=0.44,k=0.225]
> >     \definecolor[mycol_q][c=0.055,m=0.145,y=0.22,k=0.1125]
> >     \startcolor[mycol]
> >     {\bfa •••••••• Test}
> >     \stopcolor
> >
> >     \starttikzpicture
> >     \fill[mycol] (0, 0) rectangle (2,4);
> >     \fill[mycol_h] (2, 0) rectangle ++(2,4);
> >     \fill[mycol_q] (4, 0) rectangle ++(2,4);
> >     \stoptikzpicture
> >     \stoptext
> >
> >     I'm not so familiar with metafun, so I couldn't do the rectangle
> >     with metafun (the different colors between context/metafun and 
> tikz
> >     would certainly be better visible so). But the bullet shows, 
> that
> >     the text color isn't the same as the tikz-figure. But they 
> should as
> >     they are identical. Something must have changed in color 
> handling.
> >
> >     Christian
> >
> >     2015-04-14 10:42 GMT+02:00 Hans Hagen <pragma@wxs.nl
> >     <mailto:pragma@wxs.nl>>:
> >
> >         On 4/14/2015 10:29 AM, Christian Prim wrote:
> >
> >             Thanks Hans for the fix!
> >
> >             I have noticed, that spotcolors can be used in tikz, but
> >             they are
> >             darker. Is that wanted or a bug?
> >
> >
> >         they will map onto cmyk or rgb depending on definitions ...
> >         don't expect advanced context color models to work with tikz
> >         (but they do work with metafun)
> >
> >
> >         Hans
> >
> >         
> ------------------------------__------------------------------__-----
> >                                                    Hans Hagen | 
> PRAGMA ADE
> >                        Ridderstraat 27 | 8061 GH Hasselt | The 
> Netherlands
> >              tel: 038 477 53 69 | voip: 087 875 68 74
> >         <tel:087%20875%2068%2074> | www.pragma-ade.com
> >         <http://www.pragma-ade.com>
> >                                                       |
> >         www.pragma-pod.nl <http://www.pragma-pod.nl>
> >         
> ------------------------------__------------------------------__-----
> >         
> _______________________________________________________________________________________
> >         If your question is of interest to others as well, please 
> add an
> >         entry to the Wiki!
> >
> >         maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> /
> >         http://www.ntg.nl/mailman/__listinfo/ntg-context
> >         <http://www.ntg.nl/mailman/listinfo/ntg-context>
> >         webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> >         archive  : http://foundry.supelec.fr/__projects/contextrev/
> >         <http://foundry.supelec.fr/projects/contextrev/>
> >         wiki     : http://contextgarden.net
> >         
> _______________________________________________________________________________________
> >
> >
> >
> >
> >
> > 
> ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an 
> entry to the Wiki!
> >
> > maillist : ntg-context@ntg.nl / 
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> > archive  : http://foundry.supelec.fr/projects/contextrev/
> > wiki     : http://contextgarden.net
> > 
> ___________________________________________________________________________________
> >
> 
> 
> --
> 
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                               | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an 
> entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 8641 bytes --]

[-- Attachment #2.1: old.pdf --]
[-- Type: application/pdf, Size: 4886 bytes --]

[-- Attachment #2.2: new.pdf --]
[-- Type: application/pdf, Size: 4795 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-16 21:29             ` Christian Prim
@ 2015-04-16 23:27               ` Hans Hagen
  2015-04-24 13:05                 ` Christian Prim
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2015-04-16 23:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/16/2015 11:29 PM, Christian Prim wrote:
> Hi Hans
>
> sorry to ask again. But the different color handling between
> context-version before 2015.04.14 00:54 and
> context-version 2015.04.14 00:54 is remarkable and annoying.
>
> See attached pdf-documents. Both have exactly the same source:
>
> \usemodule[tikz]
> \setupbodyfont[40pt]
> \starttext
> \definecolor[mycola][c=0.23,m=0.58,y=0.88,k=0.45]
> \definecolor[mycolb][c=0.115,m=0.29,y=0.44,k=0.225]
> \definecolor[mycolc][c=0.055,m=0.145,y=0.22,k=0.1125]
>
> \starttikzpicture
> \node[fill=mycola,rectangle, minimum height=4cm,minimum
> width=2cm,anchor=south west] {\startcolor[mycola]T\stopcolor};
> \node[fill=mycolb,rectangle, minimum height=4cm,minimum
> width=2cm,anchor=south west] at (2,0) {\startcolor[mycolb]T\stopcolor};
> \node[fill=mycolc,rectangle, minimum height=4cm,minimum
> width=2cm,anchor=south west] at (4,0) {\startcolor[mycolc]T\stopcolor};
> \stoptikzpicture
> \stoptext
>
> I write in each box the letter T with exactly the same color as the
> underlying box. Textcolor is set using context, fill color of the box is
> set using tikz.
>
> old.pdf shows the correct color handling. The letter T has exactly the
> same color as the box and therefore disappears.
>
> With newest beta (new.pdf) the letter T is visible.
>
> Must I now stay with an old beta or can this "bug" be fixed? Perhaps
> it's a bug in tikz...

i found out that it relates to the lack of gray support (which in fact 
seems to be rgb support)

so the next beta might work ok for you (no upload yet)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-16 23:27               ` Hans Hagen
@ 2015-04-24 13:05                 ` Christian Prim
  2015-04-25 21:18                   ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Prim @ 2015-04-24 13:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4219 bytes --]

Hi Hans

I don't know if the latest beta already has the new code. But I can
confirm, that there is still a difference between tikz-colors and
context/metafun colors.

TikZ translates c=1,m=1 in (native) RGB, that is b=1, which is in some way
correct.
ConTeXt translates c=1,m=1 in something I couldn't really define (perhaps
sRGB or some other color profile) r=0.183... g=0.191... b=0.574... or in
Web-Hex: #2e3092

or back to cmyk: c=.68, m=.67,k=.43 (which is blue with some key-value
compared to TikZ with k=0)

So I think that TikZ and ConTeXt don't use the same color profile....

Hope it could help somewhat to solve my problem.

Thanks
Christian

PS.: New MWE with output.pdf attached.

\usemodule[tikz]
\usetypescript[palatino]
\setupbodyfont[palatino,40pt]
\starttext
\definecolor[mycola][c=1,m=1,y=0,k=0]
\definecolor[mycolb][c=0.5,m=0.5,y=0,k=0]
\definecolor[mycolc][c=0.25,m=0.25,y=0,k=0]

\starttikzpicture
\node[fill=mycola,rectangle, minimum height=4cm,minimum width=2cm]
{\startcolor[mycola]T\stopcolor};
\node[fill=mycolb,rectangle, minimum height=4cm,minimum width=2cm] at (2,0)
{\startcolor[mycolb]T\stopcolor};
\node[fill=mycolc,rectangle, minimum height=4cm,minimum width=2cm] at (4,0)
{\startcolor[mycolc]T\stopcolor};
\stoptikzpicture

\startMPcode
 fill fullsquare xscaled 2cm yscaled 4cm withcolor \MPcolor{mycola};
 fill fullsquare xscaled 2cm yscaled 4cm xshifted 2cm withcolor
\MPcolor{mycolb};
 fill fullsquare xscaled 2cm yscaled 4cm xshifted 4cm withcolor
\MPcolor{mycolc};
\stopMPcode

\par
\startcolor[mycola]T\stopcolor
\startcolor[mycolb]T\stopcolor
\startcolor[mycolc]T\stopcolor
\stoptext


2015-04-17 1:27 GMT+02:00 Hans Hagen <pragma@wxs.nl>:

> On 4/16/2015 11:29 PM, Christian Prim wrote:
>
>> Hi Hans
>>
>> sorry to ask again. But the different color handling between
>> context-version before 2015.04.14 00:54 and
>> context-version 2015.04.14 00:54 is remarkable and annoying.
>>
>> See attached pdf-documents. Both have exactly the same source:
>>
>> \usemodule[tikz]
>> \setupbodyfont[40pt]
>> \starttext
>> \definecolor[mycola][c=0.23,m=0.58,y=0.88,k=0.45]
>> \definecolor[mycolb][c=0.115,m=0.29,y=0.44,k=0.225]
>> \definecolor[mycolc][c=0.055,m=0.145,y=0.22,k=0.1125]
>>
>> \starttikzpicture
>> \node[fill=mycola,rectangle, minimum height=4cm,minimum
>> width=2cm,anchor=south west] {\startcolor[mycola]T\stopcolor};
>> \node[fill=mycolb,rectangle, minimum height=4cm,minimum
>> width=2cm,anchor=south west] at (2,0) {\startcolor[mycolb]T\stopcolor};
>> \node[fill=mycolc,rectangle, minimum height=4cm,minimum
>> width=2cm,anchor=south west] at (4,0) {\startcolor[mycolc]T\stopcolor};
>> \stoptikzpicture
>> \stoptext
>>
>> I write in each box the letter T with exactly the same color as the
>> underlying box. Textcolor is set using context, fill color of the box is
>> set using tikz.
>>
>> old.pdf shows the correct color handling. The letter T has exactly the
>> same color as the box and therefore disappears.
>>
>> With newest beta (new.pdf) the letter T is visible.
>>
>> Must I now stay with an old beta or can this "bug" be fixed? Perhaps
>> it's a bug in tikz...
>>
>
> i found out that it relates to the lack of gray support (which in fact
> seems to be rgb support)
>
> so the next beta might work ok for you (no upload yet)
>
> Hans
>
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 7002 bytes --]

[-- Attachment #2: output.pdf --]
[-- Type: application/pdf, Size: 5039 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-24 13:05                 ` Christian Prim
@ 2015-04-25 21:18                   ` Hans Hagen
  2015-05-14  7:56                     ` Christian Prim
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2015-04-25 21:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/24/2015 3:05 PM, Christian Prim wrote:
> Hi Hans
>
> I don't know if the latest beta already has the new code. But I can
> confirm, that there is still a difference between tikz-colors and
> context/metafun colors.
>
> TikZ translates c=1,m=1 in (native) RGB, that is b=1, which is in some
> way correct.
> ConTeXt translates c=1,m=1 in something I couldn't really define
> (perhaps sRGB or some other color profile) r=0.183... g=0.191...
> b=0.574... or in Web-Hex: #2e3092
>
> or back to cmyk: c=.68, m=.67,k=.43 (which is blue with some key-value
> compared to TikZ with k=0)
>
> So I think that TikZ and ConTeXt don't use the same color profile....
>
> Hope it could help somewhat to solve my problem.

your example works ok here (with the tikz def file i made last week)

i also made

\setupcolors[cmyk=no]
\setupcolors[rgb=no]
\setupcolors[cmyk=no,rgb=no]
\setupcolors[state=stop]

working (nothing needed in tikz as the code that interfaces to it does 
that) which will be in the next beta

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ConTeXt-defined colours broken in TikZ in MkIV with latest betas
  2015-04-25 21:18                   ` Hans Hagen
@ 2015-05-14  7:56                     ` Christian Prim
  0 siblings, 0 replies; 13+ messages in thread
From: Christian Prim @ 2015-05-14  7:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2147 bytes --]

Thanks Hans

with context-version 2015.05.13 23:52 it finally works on my side! Thanks
for the fix!

Christian

2015-04-25 23:18 GMT+02:00 Hans Hagen <pragma@wxs.nl>:

> On 4/24/2015 3:05 PM, Christian Prim wrote:
>
>> Hi Hans
>>
>> I don't know if the latest beta already has the new code. But I can
>> confirm, that there is still a difference between tikz-colors and
>> context/metafun colors.
>>
>> TikZ translates c=1,m=1 in (native) RGB, that is b=1, which is in some
>> way correct.
>> ConTeXt translates c=1,m=1 in something I couldn't really define
>> (perhaps sRGB or some other color profile) r=0.183... g=0.191...
>> b=0.574... or in Web-Hex: #2e3092
>>
>> or back to cmyk: c=.68, m=.67,k=.43 (which is blue with some key-value
>> compared to TikZ with k=0)
>>
>> So I think that TikZ and ConTeXt don't use the same color profile....
>>
>> Hope it could help somewhat to solve my problem.
>>
>
> your example works ok here (with the tikz def file i made last week)
>
> i also made
>
> \setupcolors[cmyk=no]
> \setupcolors[rgb=no]
> \setupcolors[cmyk=no,rgb=no]
> \setupcolors[state=stop]
>
> working (nothing needed in tikz as the code that interfaces to it does
> that) which will be in the next beta
>
>
> Hans
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3557 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-05-14  7:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13 17:45 ConTeXt-defined colours broken in TikZ in MkIV with latest betas Mojca Miklavec
2015-04-13 18:13 ` Christian Prim
2015-04-13 20:51 ` Hans Hagen
2015-04-14  8:29   ` Christian Prim
2015-04-14  8:42     ` Hans Hagen
2015-04-14  9:54       ` Christian Prim
2015-04-16 19:34         ` Christian Prim
2015-04-16 19:58           ` Hans Hagen
2015-04-16 21:29             ` Christian Prim
2015-04-16 23:27               ` Hans Hagen
2015-04-24 13:05                 ` Christian Prim
2015-04-25 21:18                   ` Hans Hagen
2015-05-14  7:56                     ` Christian Prim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).