bug: colors in TikZ/ConTeXt MKIV
Dear Till/Christian/Hans, The following is broken in ConTeXt MKIV (assuming the usage of patched TikZ to allow running it under MKIV at all), but works fine in ConTeXt MKII: \usemodule[tikz] \starttext \starttikzpicture \node[circle,ball color=red!10] (a) at (0,0,0) {$p_x$}; \stoptikzpicture \stoptext Mojca
2010/11/26 Mojca Miklavec
Dear Till/Christian/Hans,
The following is broken in ConTeXt MKIV (assuming the usage of patched TikZ to allow running it under MKIV at all), but works fine in ConTeXt MKII:
\usemodule[tikz] \starttext
\starttikzpicture \node[circle,ball color=red!10] (a) at (0,0,0) {$p_x$}; \stoptikzpicture
\stoptext
Mojca
Same here. Regards, Vedran Miletić
On 27-11-2010 12:04, Vedran Miletić wrote:
2010/11/26 Mojca Miklavec
Dear Till/Christian/Hans,
The following is broken in ConTeXt MKIV (assuming the usage of patched TikZ to allow running it under MKIV at all), but works fine in ConTeXt MKII:
\usemodule[tikz] \starttext
\starttikzpicture \node[circle,ball color=red!10] (a) at (0,0,0) {$p_x$}; \stoptikzpicture
\stoptext
Mojca
Same here.
\starttikzpicture \node[circle,ball color=darkred] (a) at (0,0,0) {$p_x$}; \stoptikzpicture \starttikzpicture \node[circle,ball color=red] (a) at (0,0,0) {$p_x$}; \stoptikzpicture \definecolor[myred][r=.1] \starttikzpicture \node[circle,ball color=myred] (a) at (0,0,0) {$p_x$}; \stoptikzpicture ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On 27-11-2010 2:16, Mojca Miklavec wrote:
On Sat, Nov 27, 2010 at 13:29, Hans Hagen wrote:
\starttikzpicture \node[circle,ball color=darkred] (a) at (0,0,0) {$p_x$}; \stoptikzpicture
I made a workaround in that way, but it's still a bug ...
I have no clue what the ! does apart from defining a color red at 10% but I do know that context ignores it. 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 -----------------------------------------------------------------
On Sat, 2010-11-27 at 14:25 +0100, Hans Hagen wrote:
On 27-11-2010 2:16, Mojca Miklavec wrote:
On Sat, Nov 27, 2010 at 13:29, Hans Hagen wrote:
\starttikzpicture \node[circle,ball color=darkred] (a) at (0,0,0) {$p_x$}; \stoptikzpicture
I made a workaround in that way, but it's still a bug ...
I have no clue what the ! does apart from defining a color red at 10% but I do know that context ignores it.
Hans
The '!' is actually pretty neat, since it allows you to blend colors. By
default, tikz blends colors with white, so
red!10
means mix 10% red with 90% white. This has the advantage that I can take
any color, say
\definecolor[mycolor][r=0.42,g=1.,b=0.2]
and lighten it 50% by just using
mycolor!50
I can also blend two colors together, using
colorA!50!colorB
I'm also pretty sure that context didn't always ignore the exclamation
mark. Is there a way to reverse this behaviour?
PS I've tried using spot colors in context, but that doesn't seem to
work:
\definespotcolor[mycolor][red][p=.1]
--
Michael Murphy MPhys
On 1-12-2010 1:36, Michael Murphy wrote:
On Sat, 2010-11-27 at 14:25 +0100, Hans Hagen wrote:
On 27-11-2010 2:16, Mojca Miklavec wrote:
On Sat, Nov 27, 2010 at 13:29, Hans Hagen wrote:
\starttikzpicture \node[circle,ball color=darkred] (a) at (0,0,0) {$p_x$}; \stoptikzpicture
I made a workaround in that way, but it's still a bug ...
I have no clue what the ! does apart from defining a color red at 10% but I do know that context ignores it.
Hans
The '!' is actually pretty neat, since it allows you to blend colors. By default, tikz blends colors with white, so
red!10
means mix 10% red with 90% white. This has the advantage that I can take any color, say
\definecolor[mycolor][r=0.42,g=1.,b=0.2]
and lighten it 50% by just using
mycolor!50
I can also blend two colors together, using
colorA!50!colorB
I'm also pretty sure that context didn't always ignore the exclamation mark. Is there a way to reverse this behaviour?
I'm pretty sure that I never implemented something using a questionmark. However, we do have: \definecolor[red-t] [r=1,t=0.5,a=1] \definecolor[green-t][g=1,t=0.5,a=1] \defineintermediatecolor[mycolora][0.5,red,green] \defineintermediatecolor[mycolorb][0.5,red-t,green-t] \starttext test {\mycolora OEPS} test test {\mycolorb OEPS} test \stoptext I could probably support \definecolor[xxx][0.5(red,green)] \definecolor[xxx][0.5(red)] which looks better than this ! and is less likely to conflict with names as abc! is a rather value color name. 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 -----------------------------------------------------------------
I'm pretty sure that I never implemented something using a questionmark. However, we do have:
\definecolor[red-t] [r=1,t=0.5,a=1] \definecolor[green-t][g=1,t=0.5,a=1] \defineintermediatecolor[mycolora][0.5,red,green] \defineintermediatecolor[mycolorb][0.5,red-t,green-t]
\starttext test {\mycolora OEPS} test test {\mycolorb OEPS} test \stoptext
I could probably support
\definecolor[xxx][0.5(red,green)] \definecolor[xxx][0.5(red)]
which looks better than this ! and is less likely to conflict with names as abc! is a rather value color name.
OK, thanks. Last question then: is there a way to redefine standard colors? Something like: \redefinecolor[red][r=0,g=1,b=0] -- Michael Murphy
Am 01.12.2010 um 18:37 schrieb Michael Murphy:
OK, thanks. Last question then: is there a way to redefine standard colors? Something like:
\redefinecolor[red][r=0,g=1,b=0]
\starttext \definecolor[test][r=1]\color[test]{red?} \definecolor[test][g=1]\color[test]{red?} \definecolor[test][b=1]\color[test]{red?} \stoptext Wolfgang
On Wed, Dec 1, 2010 at 7:58 AM, Hans Hagen
I could probably support
\definecolor[xxx][0.5(red,green)] \definecolor[xxx][0.5(red)]
which looks better than this ! and is less likely to conflict with names as abc! is a rather value color name.
That will be a nice feature to have (especially, if it can also be used with \definedcolor) Aditya
On 2-12-2010 5:02, Aditya Mahajan wrote:
On Wed, Dec 1, 2010 at 7:58 AM, Hans Hagen
wrote: I could probably support
\definecolor[xxx][0.5(red,green)] \definecolor[xxx][0.5(red)]
which looks better than this ! and is less likely to conflict with names as abc! is a rather value color name.
That will be a nice feature to have (especially, if it can also be used with \definedcolor)
You mean \colored[0.5(red)] ? That works ok. ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Thu, 2 Dec 2010, Hans Hagen wrote:
On 2-12-2010 5:02, Aditya Mahajan wrote:
On Wed, Dec 1, 2010 at 7:58 AM, Hans Hagen
wrote: I could probably support
\definecolor[xxx][0.5(red,green)] \definecolor[xxx][0.5(red)]
which looks better than this ! and is less likely to conflict with names as abc! is a rather value color name.
That will be a nice feature to have (especially, if it can also be used with \definedcolor)
You mean \colored[0.5(red)] ? That works ok.
Indeed. That is what I meant. I did not know that the metapost like syntax worked for \colored. Aditya
On 2-12-2010 12:01, Aditya Mahajan wrote:
Indeed. That is what I meant. I did not know that the metapost like syntax worked for \colored.
\colored is just a shortcut to \definecolor ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Wednesday 01 December 2010 13:58:23 Hans Hagen wrote:
I could probably support
\definecolor[xxx][0.5(red,green)] \definecolor[xxx][0.5(red)]
which looks better than this ! and is less likely to conflict with names as abc! is a rather value color name.
Indeed, a favorite color is "surprisepink!" \definecolor [roscolux51] [h=aaacd5] % Touch of color when white light is not desirable. \definecolor [surprisepink!] [roscolux51] The TiKz syntax "red!50!green" is short, sweet and rather strange. But the question remains on how to support full TiKz use under ConTeXt. In Metapost, we have 0.5[red,green] (does this work with colors?). Would \definecolor[xxx][0.5[red,green]] be a better alternative? Is such a syntax possible? Would this be readable? The next step would be to allow \color[0.5[red,green]] (or \color[0.5(red,green)]), i.e. such syntax wherever a color can be used. Alan
On 2-12-2010 8:19, Alan BRASLAU wrote:
The next step would be to allow \color[0.5[red,green]] (or \color[0.5(red,green)]), i.e. such syntax wherever a color can be used.
You can use \definecolor[mycolor][.5(red,green)] in the current beta, but I wonder if \color[0.5(red,green)] makes much sense as that would complicate (and definitely slow down) color switching. But, as Aditya pointer out you can use {\colored[0.5(green)]test} already. I don't want to get away too much from the principle of defining colors using names. 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 -----------------------------------------------------------------
participants (7)
-
Aditya Mahajan
-
Alan BRASLAU
-
Hans Hagen
-
Michael Murphy
-
Mojca Miklavec
-
Vedran Miletić
-
Wolfgang Schuster