ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Color problem
@ 2021-05-21  2:33 Rik Kabel
  2021-05-21  2:47 ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Rik Kabel @ 2021-05-21  2:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Consider the following example:

    \define \HighlightColor {red}
    \definehighlight[RED][color=\HighlightColor]
    \definelabel[AA][alternative=inright,headcolor=\HighlightColor,text=]
    \definelabel[BB][alternative=inright,headcolor=red,text=]
    \noheaderandfooterlines
    \starttext
    \hsize3cm
    Is the label red?\AA

    Is the label red?\BB

    \RED{Is this line red?}
    \stoptext

When run with --luatex, I get the colors I expect, as:

When run as lmtx, I get this:

All test were run with ConTeXt  ver: 2021.05.20 11:08 MKIV  fmt: 2021.5.20.

This worked very well for a long time, then became a problem a while 
ago, then it resolved, and once more it is a problem.

-- 
Rik


[-- Attachment #1.2.1: Type: text/html, Size: 1438 bytes --]

[-- Attachment #1.2.2: mhipfgogebiffnek.png --]
[-- Type: image/png, Size: 9033 bytes --]

[-- Attachment #1.2.3: mjhnekedignjbmej.png --]
[-- Type: image/png, Size: 9564 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Color problem
  2021-05-21  2:33 Color problem Rik Kabel
@ 2021-05-21  2:47 ` Aditya Mahajan
  2021-05-21  4:26   ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2021-05-21  2:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 20 May 2021, Rik Kabel wrote:

> Consider the following example:
> 
>    \define \HighlightColor {red}

Why not just use:

\definecolor[HighlightColor][red] 

and then use color=HighlightColor, etc.

>    \definehighlight[RED][color=\HighlightColor]
>    \definelabel[AA][alternative=inright,headcolor=\HighlightColor,text=]
>    \definelabel[BB][alternative=inright,headcolor=red,text=]
>    \noheaderandfooterlines
>    \starttext
>    \hsize3cm
>    Is the label red?\AA
> 
>    Is the label red?\BB
> 
>    \RED{Is this line red?}
>    \stoptext

Aditya
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Color problem
  2021-05-21  2:47 ` Aditya Mahajan
@ 2021-05-21  4:26   ` Wolfgang Schuster
  2021-05-21 13:52     ` Rik Kabel
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2021-05-21  4:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan schrieb am 21.05.2021 um 04:47:
> On Thu, 20 May 2021, Rik Kabel wrote:
>
>> Consider the following example:
>>
>>     \define \HighlightColor {red}
> Why not just use:
>
> \definecolor[HighlightColor][red]
>
> and then use color=HighlightColor, etc.

This is the better way to create unique color names but the problem
in the example was the use of \define instead of \defineexpandable.

\defineexpandable\HighlightColor{red}

Wolfgang
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Color problem
  2021-05-21  4:26   ` Wolfgang Schuster
@ 2021-05-21 13:52     ` Rik Kabel
  0 siblings, 0 replies; 7+ messages in thread
From: Rik Kabel @ 2021-05-21 13:52 UTC (permalink / raw)
  To: ntg-context

On 5/21/2021 00:26, Wolfgang Schuster wrote:
> Aditya Mahajan schrieb am 21.05.2021 um 04:47:
>> On Thu, 20 May 2021, Rik Kabel wrote:
>>
>>> Consider the following example:
>>>
>>>     \define \HighlightColor {red}
>> Why not just use:
>>
>> \definecolor[HighlightColor][red]
>>
>> and then use color=HighlightColor, etc.
>
> This is the better way to create unique color names but the problem
> in the example was the use of \define instead of \defineexpandable.
>
> \defineexpandable\HighlightColor{red}
>
> Wolfgang
>
Wolfgang and Aditya,

Thank you both for the lesson.

Is the difference between MkIV (--luatex) and LMTX due to stricter 
application of expandability in LMTX?

-- 
Rik

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: color problem
  2020-10-01 18:55 color problem Susanne G. Loeber
  2020-10-02  7:10 ` Taco Hoekwater
@ 2020-10-02 12:14 ` Henri Menke
  1 sibling, 0 replies; 7+ messages in thread
From: Henri Menke @ 2020-10-02 12:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 01/10/20, 20:55, Susanne G. Loeber wrote:
> Dear Reader,
> 
> I have a colored section, text in another color and a TikZ picture with a
> differently colored node, following each other. However, either the node
> gets the wrong color or the following paragraph, see example below.
> 
> Is there something wrong with the section settings? How do I get all the
> colors right without using a paragraph in between?

From experience, this usually works:

\prependvalue{starttikzpicture}{\dontleavehmode\forcecolorhack}

Cheers, Henri

> 
> \setuphead[chapter]
> 
> [
> 
> style={\tfd},
> 
> color={A2plus},
> 
> ]
> 
> \setuphead[section]
> 
> [
> 
> style={\tfc},
> 
> color={A3plus},
> 
> ]
> 
> 
> \definecolor[A1plus][h=5CAF00]
> 
> \definecolor[A2plus][h=B6437E]
> 
> \definecolor[A3plus][h=606ABD]
> 
> \definecolor[A4plus][h=FFC700]
> 
> \definecolor[A5plus][h=D0202B]
> 
> \definecolor[A6plus][h=EF8600]
> 
> \definecolor[A7plus][h=0082AA]
> 
> 
> \setupcolors[textcolor=A1plus]
> 
> 
> \usemodule[tikz]
> 
> 
> 
> \starttext
> 
> 
> \startchapter[title={Colour test}, ref=colourtest]
> 
> 
> \startsection[title={Section}]
> 
> \starttikzpicture
> 
> \draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text should be
> orange};
> 
> \stoptikzpicture
> 
> 
> \par This a paragraph which gets the colour of the section for no reason.
> 
> 
> \stopsection
> 
> 
> \stopchapter
> 
> 
> \startchapter[title={Colour test 2}, ref=colourtest]
> 
> 
> \startsection[title={Another section }]
> 
> 
> \par This a paragraph in the appropriate text color (green).
> 
> 
> 
> \starttikzpicture
> 
> \draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text is orange};
> 
> \stoptikzpicture
> 
> 
> \stopsection
> 
> 
> \stopchapter
> 
> \stoptext

> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: color problem
  2020-10-01 18:55 color problem Susanne G. Loeber
@ 2020-10-02  7:10 ` Taco Hoekwater
  2020-10-02 12:14 ` Henri Menke
  1 sibling, 0 replies; 7+ messages in thread
From: Taco Hoekwater @ 2020-10-02  7:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

> On 1 Oct 2020, at 20:55, Susanne G. Loeber <dekleurenfamilie@gmail.com> wrote:
> 
> Dear Reader, 
> 
> I have a colored section, text in another color and a TikZ picture with a differently colored node, following each other. However, either the node gets the wrong color or the following paragraph, see example below. 
> 
> Is there something wrong with the section settings? How do I get all the colors right without using a paragraph in between? 

Some of the blackbox magic in the tikz module is confusing ConTeXt, it seems. This works:

  \draw (0,0) rectangle (2,1) node[right] {\color[A6plus]{node text should be orange}}; 

But that’s all I know. I do not understand the tikz module at all.

Best wishes,
Taco
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* color problem
@ 2020-10-01 18:55 Susanne G. Loeber
  2020-10-02  7:10 ` Taco Hoekwater
  2020-10-02 12:14 ` Henri Menke
  0 siblings, 2 replies; 7+ messages in thread
From: Susanne G. Loeber @ 2020-10-01 18:55 UTC (permalink / raw)
  To: ntg-context


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

Dear Reader,

I have a colored section, text in another color and a TikZ picture with a
differently colored node, following each other. However, either the node
gets the wrong color or the following paragraph, see example below.

Is there something wrong with the section settings? How do I get all the
colors right without using a paragraph in between?

\setuphead[chapter]

[

style={\tfd},

color={A2plus},

]

\setuphead[section]

[

style={\tfc},

color={A3plus},

]


\definecolor[A1plus][h=5CAF00]

\definecolor[A2plus][h=B6437E]

\definecolor[A3plus][h=606ABD]

\definecolor[A4plus][h=FFC700]

\definecolor[A5plus][h=D0202B]

\definecolor[A6plus][h=EF8600]

\definecolor[A7plus][h=0082AA]


\setupcolors[textcolor=A1plus]


\usemodule[tikz]



\starttext


\startchapter[title={Colour test}, ref=colourtest]


\startsection[title={Section}]

\starttikzpicture

\draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text should be
orange};

\stoptikzpicture


\par This a paragraph which gets the colour of the section for no reason.


\stopsection


\stopchapter


\startchapter[title={Colour test 2}, ref=colourtest]


\startsection[title={Another section }]


\par This a paragraph in the appropriate text color (green).



\starttikzpicture

\draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text is orange};

\stoptikzpicture


\stopsection


\stopchapter

\stoptext

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2021-05-21 13:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21  2:33 Color problem Rik Kabel
2021-05-21  2:47 ` Aditya Mahajan
2021-05-21  4:26   ` Wolfgang Schuster
2021-05-21 13:52     ` Rik Kabel
  -- strict thread matches above, loose matches on Subject: below --
2020-10-01 18:55 color problem Susanne G. Loeber
2020-10-02  7:10 ` Taco Hoekwater
2020-10-02 12:14 ` Henri Menke

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).