Difference between revisions of "Command/definecolorgroup"

From Wiki
Jump to navigation Jump to search
m (cleanup)
(13 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
}}
 
}}
  
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>definecolorgroup</syntax>
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
Line 23: Line 25:
 
</table>
 
</table>
  
 +
== Description ==
 +
{{cmd|definecolorgroup|[myblue][rgb][0:0:1,0:0;0.6,0:0:3]}} defines three colours {{code|myblue:1}}, {{code|myblue:2}}, {{code|myblue:3}}. If one defines similar gamuts for e.g. green and red, such that equal numbers correspond to equal grayscales, one can easily pick a red, a green, and a blue so that the colours still differ from each other when converted to grayscale.
 +
 +
ConTeXt has predefined colorgroups for red, green, blue, cyan, magenta, yellow, and gray; these are defined in {{src|colo-rgb.mkii}} for MkII, and {{src|colo-imp-dem.mkiv}} ('dem' for 'demo')for MkIV, and may be imported with {{cmd|usecolors}}.
 +
 +
== Example ==
 +
<context source=yes mode=mkiv>
 +
% mode=mkiv
 +
\usecolors[dem] % use predefined demo colors
  
== Description ==
+
% NB: The grayshades of this colorgroup are not calibrated
 +
% to the ones in colo-imp-dem.mkiv
 +
\definecolorgroup
 +
  [orange]
 +
  [1.00:0.85:0.80,
 +
    1.00:0.80:0.30,
 +
    0.80:0.50:0.00]
  
 +
\definepalet[mypalet]
 +
  [myorange=orange:2,
 +
      myred=red:4,
 +
      myblue=blue:6,
 +
    mygreen=green:8]
  
 +
\showcolorgroup[orange]
  
== Example ==
+
\comparepalet[mypalet]
<!-- Please fill in an example if you can -->
+
</context>
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
{{Color navbox}}
 +
 
 +
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Reference/en|definecolorgroup]]
+
[[Category:Command/Colors|definecolorgroup]]

Revision as of 13:35, 13 October 2019

\definecolorgroup

Syntax (autogenerated)

\definecolorgroup[...][...][x:y:z=,...]
[...]name
[...]gray rgb cmyk spot
[x:y:z=,...]triplet


Syntax

\definecolorgroup[...][...][x:y:z=,...]
[...] name
[...] rgb cmyk gray s
[x:y:z=,...]

Description

\definecolorgroup[myblue][rgb][0:0:1,0:0;0.6,0:0:3] defines three colours myblue:1, myblue:2, myblue:3. If one defines similar gamuts for e.g. green and red, such that equal numbers correspond to equal grayscales, one can easily pick a red, a green, and a blue so that the colours still differ from each other when converted to grayscale.

ConTeXt has predefined colorgroups for red, green, blue, cyan, magenta, yellow, and gray; these are defined in colo-rgb.mkii for MkII, and colo-imp-dem.mkiv ('dem' for 'demo')for MkIV, and may be imported with \usecolors.

Example

% mode=mkiv
\usecolors[dem] % use predefined demo colors

% NB: The grayshades of this colorgroup are not calibrated
% to the ones in colo-imp-dem.mkiv
\definecolorgroup
   [orange]
   [1.00:0.85:0.80,
    1.00:0.80:0.30,
    0.80:0.50:0.00]

\definepalet[mypalet]
   [myorange=orange:2,
       myred=red:4,
      myblue=blue:6,
     mygreen=green:8]

\showcolorgroup[orange]

\comparepalet[mypalet]

See also


Help from ConTeXt-Mailinglist/Forum

All issues with: