ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* colors without \definecolor
@ 2010-02-04 20:41 Philipp Gesang
  2010-02-05  7:31 ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Philipp Gesang @ 2010-02-04 20:41 UTC (permalink / raw)
  To: ntg-context


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

Hi all,


I understand that in order to use a color with \color[somecolor]{colored
text} I first have to \definecolor[somecolor][r=.4,g=0,b=1].  Currently
I'm trying to do automated colorizing with the help of some lua code and
I'd like to make up rgb vectors on the spot without having to
\definecolor them first, e.g. something like \color[r=.4,g=0,b=1]
{colored text}.  Is there a way to achieve this in mkiv?  (Right now I'm
assigning new rgb values to the same color "name" whenever the function
is called that concatenates the next \color[]{} statement.  This seems a
bit verbose and hacky to me.)

Thanks in advance,


Philipp
-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 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] 11+ messages in thread

* Re: colors without \definecolor
  2010-02-04 20:41 colors without \definecolor Philipp Gesang
@ 2010-02-05  7:31 ` Wolfgang Schuster
  2010-02-05 14:49   ` Philipp Gesang
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2010-02-05  7:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 04.02.10 21:41, schrieb Philipp Gesang:
> Hi all,
>
>
> I understand that in order to use a color with \color[somecolor]{colored
> text} I first have to \definecolor[somecolor][r=.4,g=0,b=1].  Currently
> I'm trying to do automated colorizing with the help of some lua code and
> I'd like to make up rgb vectors on the spot without having to
> \definecolor them first, e.g. something like \color[r=.4,g=0,b=1]
> {colored text}.  Is there a way to achieve this in mkiv?  (Right now I'm
> assigning new rgb values to the same color "name" whenever the function
> is called that concatenates the next \color[]{} statement.  This seems a
> bit verbose and hacky to me.)

\colored[r=...,g=...,b=...]{...}

or

{\colored[r=...,g=...,b=...]...}

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: colors without \definecolor
  2010-02-05  7:31 ` Wolfgang Schuster
@ 2010-02-05 14:49   ` Philipp Gesang
  2010-02-06  7:55     ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Philipp Gesang @ 2010-02-05 14:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Wolfgang, all,
On 2010-02-05 <08:31:35>, Wolfgang Schuster wrote:
> \colored[r=...,g=...,b=...]{...}
> or
> {\colored[r=...,g=...,b=...]...}
Thank you very much, I wikified it.  Is there a difference (other than
syntax) between \colored[rgb] and the according \definecolor[name][rgb]
-- \color[name] commands?

Philipp

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 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] 11+ messages in thread

* Re: colors without \definecolor
  2010-02-05 14:49   ` Philipp Gesang
@ 2010-02-06  7:55     ` Wolfgang Schuster
  2010-02-07  6:24       ` Aditya Mahajan
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2010-02-06  7:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 05.02.10 15:49, schrieb Philipp Gesang:

> Is there a difference (other than
> syntax) between \colored[rgb] and the according \definecolor[name][rgb]
> -- \color[name] commands?

No, \colored is \definecolor + \color except you can use it in the form

\colored[rgb]{...}

and

{\colored[rgb]...}

while \color can only be used as

\color[rgb]{...}.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: colors without \definecolor
  2010-02-06  7:55     ` Wolfgang Schuster
@ 2010-02-07  6:24       ` Aditya Mahajan
  2010-02-07 21:56         ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Aditya Mahajan @ 2010-02-07  6:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 6 Feb 2010, Wolfgang Schuster wrote:

> Am 05.02.10 15:49, schrieb Philipp Gesang:
>
>> Is there a difference (other than
>> syntax) between \colored[rgb] and the according \definecolor[name][rgb]
>> -- \color[name] commands?
>
> No, \colored is \definecolor + \color except you can use it in the form
>
> \colored[rgb]{...}
>
> and
>
> {\colored[rgb]...}
>
> while \color can only be used as
>
> \color[rgb]{...}.

No. Both \color[rgb]{...} and {\color[rgb]...} are valid

\definecolor[myred][r=0.65]

\starttext
{normal text \color[myred]{red text} normal text}

{normal text {\color[myred]red text} normal text}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: colors without \definecolor
  2010-02-07  6:24       ` Aditya Mahajan
@ 2010-02-07 21:56         ` Wolfgang Schuster
  2010-02-08  8:19           ` Mojca Miklavec
  2010-02-08  8:40           ` Hans Hagen
  0 siblings, 2 replies; 11+ messages in thread
From: Wolfgang Schuster @ 2010-02-07 21:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 07.02.10 07:24, schrieb Aditya Mahajan:
>> while \color can only be used as
>>
>> \color[rgb]{...}.
> No. Both \color[rgb]{...} and {\color[rgb]...} are valid
D’oh. I looked in the source and missed this but I wonder
if this had been always the case because the manuals
{and the wiki) mention only \color[name]{...}.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: colors without \definecolor
  2010-02-07 21:56         ` Wolfgang Schuster
@ 2010-02-08  8:19           ` Mojca Miklavec
  2010-02-08  8:51             ` Wolfgang Schuster
  2010-02-08  8:40           ` Hans Hagen
  1 sibling, 1 reply; 11+ messages in thread
From: Mojca Miklavec @ 2010-02-08  8:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, Feb 7, 2010 at 22:56, Wolfgang Schuster wrote:
> Am 07.02.10 07:24, schrieb Aditya Mahajan:
>>>
>>> while \color can only be used as
>>>
>>> \color[rgb]{...}.
>>
>> No. Both \color[rgb]{...} and {\color[rgb]...} are valid
>
> D’oh. I looked in the source and missed this but I wonder
> if this had been always the case because the manuals
> {and the wiki) mention only \color[name]{...}.

\colored is a rather recent command.

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] 11+ messages in thread

* Re: colors without \definecolor
  2010-02-07 21:56         ` Wolfgang Schuster
  2010-02-08  8:19           ` Mojca Miklavec
@ 2010-02-08  8:40           ` Hans Hagen
  2010-02-08  8:55             ` Wolfgang Schuster
  1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2010-02-08  8:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7-2-2010 22:56, Wolfgang Schuster wrote:
> Am 07.02.10 07:24, schrieb Aditya Mahajan:
>>> while \color can only be used as
>>>
>>> \color[rgb]{...}.
>> No. Both \color[rgb]{...} and {\color[rgb]...} are valid
> D’oh. I looked in the source and missed this but I wonder
> if this had been always the case because the manuals
> {and the wiki) mention only \color[name]{...}.

all commands that use \groupedcommand have that property


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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] 11+ messages in thread

* Re: colors without \definecolor
  2010-02-08  8:19           ` Mojca Miklavec
@ 2010-02-08  8:51             ` Wolfgang Schuster
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfgang Schuster @ 2010-02-08  8:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 08.02.10 09:19, schrieb Mojca Miklavec:

>> D’oh. I looked in the source and missed this but I wonder
>> if this had been always the case because the manuals
>> (and the wiki) mention only \color[name]{...}.
>
> \colored is a rather recent command.

I meant the manuals and wiki mention \color[name]{...}
but not the form {\color[...]...}.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: colors without \definecolor
  2010-02-08  8:40           ` Hans Hagen
@ 2010-02-08  8:55             ` Wolfgang Schuster
  2010-02-08 12:28               ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2010-02-08  8:55 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Am 08.02.10 09:40, schrieb Hans Hagen:

>> D’oh. I looked in the source and missed this but I wonder
>> if this had been always the case because the manuals
>> {and the wiki) mention only \color[name]{...}.
>
> all commands that use \groupedcommand have that property

But used \color always \groupedcommand or was this added later and the 
original definition was what is mentioned in the manual (\color[]{})?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: colors without \definecolor
  2010-02-08  8:55             ` Wolfgang Schuster
@ 2010-02-08 12:28               ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2010-02-08 12:28 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On 8-2-2010 9:55, Wolfgang Schuster wrote:
> Am 08.02.10 09:40, schrieb Hans Hagen:
>
>>> D’oh. I looked in the source and missed this but I wonder
>>> if this had been always the case because the manuals
>>> {and the wiki) mention only \color[name]{...}.
>>
>> all commands that use \groupedcommand have that property
>
> But used \color always \groupedcommand or was this added later and the
> original definition was what is mentioned in the manual (\color[]{})?

it's a very old command so it might not have used groupedcommand in the past

also, at the time of manual writing no groupedcommand like things were 
there anyway

but .. there's another reason ...

\color{...} does not grab an argument but does some aftergroup trickery 
so it might not work in all cases

also in mkii we inject literals and we could end up with dangling revert 
color cases being nodes that could interfere somehow

mkiv is more robust

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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] 11+ messages in thread

end of thread, other threads:[~2010-02-08 12:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04 20:41 colors without \definecolor Philipp Gesang
2010-02-05  7:31 ` Wolfgang Schuster
2010-02-05 14:49   ` Philipp Gesang
2010-02-06  7:55     ` Wolfgang Schuster
2010-02-07  6:24       ` Aditya Mahajan
2010-02-07 21:56         ` Wolfgang Schuster
2010-02-08  8:19           ` Mojca Miklavec
2010-02-08  8:51             ` Wolfgang Schuster
2010-02-08  8:40           ` Hans Hagen
2010-02-08  8:55             ` Wolfgang Schuster
2010-02-08 12:28               ` Hans Hagen

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