Difference between revisions of "Command/definepalet"

From Wiki
Jump to navigation Jump to search
(Remove old remark about argument parser)
(Add {{Color navbox}})
Line 21: Line 21:
  
 
== Description ==
 
== Description ==
Allows on-the-fly switching of whole sets of color name definitions.
+
 
 +
Define a set of color name definitions that can then all be activated at once with {{cmd|setuppalet}}. To inspect the palet, or to compare its colours against each other, use {{cmd|showpalet}} and {{cmd|comparepalet}}.
  
 
{{cmd|definepalet}} used to rely on a non-standard argument parser that would
 
{{cmd|definepalet}} used to rely on a non-standard argument parser that would
Line 29: Line 30:
 
<context source=yes>
 
<context source=yes>
 
\setupcolors [x11]
 
\setupcolors [x11]
\definepalet [colorful] [primary=green]
+
\definepalet [colorful] [alert=green]
\definepalet [bleak]    [primary=darkgray]
+
\definepalet [bleak]    [alert=darkgray]
 
\starttext
 
\starttext
  
 
\setuppalet  [colorful]
 
\setuppalet  [colorful]
\color[primary]{Ain't I a colorful entity?}
+
\color[alert]{Ain't I a colorful entity?}
  
 
\setuppalet  [bleak]
 
\setuppalet  [bleak]
\color[primary]{Ain't I a colorful entity?}
+
\color[alert]{Ain't I a colorful entity?}
  
 
\stoptext
 
\stoptext
Line 43: Line 44:
  
 
== See also ==
 
== See also ==
<!-- something like {{cmd|goto}} -->
+
 
 +
{{Color navbox}}
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==

Revision as of 11:55, 13 May 2013

\definepalet

Syntax

\definepalet[...][...,...=...,...]
[...] name
name name


Description

Define a set of color name definitions that can then all be activated at once with \setuppalet. To inspect the palet, or to compare its colours against each other, use \showpalet and \comparepalet.

\definepalet used to rely on a non-standard argument parser that would not tolerate trailing commas [1]. This is no longer the case, but sufficiently old installation might still exhibit the problem.

Example

\setupcolors [x11]
\definepalet [colorful] [alert=green]
\definepalet [bleak]    [alert=darkgray]
\starttext

\setuppalet  [colorful]
\color[alert]{Ain't I a colorful entity?}

\setuppalet  [bleak]
\color[alert]{Ain't I a colorful entity?}

\stoptext

See also


Help from ConTeXt-Mailinglist/Forum

All issues with: