Changes

Jump to navigation Jump to search
1,215 bytes added ,  13:46, 8 June 2020
m
Reverted edits by Garulfo (talk) to last revision by Hraban
}}
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>definecolor</syntax>
== [[Help:Reference|Syntax]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
<tr valign="top" class="second">
<td class="cmd">[[Command/keyword:h|h]]</td>
<td>[[Command/value:number|number]] hue (HSB/HWB, 0–360)</td>
</tr>
<tr valign="top" class="second">
<tr valign="top" class="second">
<td class="cmd">[[Command/keyword:v|v]]</td>
<td>[[Command/value:number|number]] brightness/value (HSB), blackness (HWB)</td> </tr> <tr valign="top" class="second"> <td class="cmd">[[Command/keyword:w|w]]</td> <td>[[Command/value:number|number]] whiteness (HWB)</td>
</tr>
<tr valign="top" class="second">
<tr valign="top" class="second">
<td class="cmd">[[Command/keyword:x|x]]</td>
<td>[[Command/value:text|text]] Hexadecimal RGB value (like in HTML), only with hex module</td>
</tr>
</table>
<code>\color</code> command.
 ===Hex colors in MkII===To use hexadecimal colors in mkii MkII you need to load the proper module first:
<texcode>
Then the colors can be specified with
<texcode>
\definecolor[hex-red][h=FF0000]% it’s h instead of x in MkII
</texcode>
===Transparency=== Regarding the key « {{code|a »}}, which means transparency alternative method, there are a certain number of values (actually at least 13, from 0 to 12) whose meanings can be seen from below:
<texcode>
\definetransparency [difference] [11]
\definetransparency [exclusion] [12]
</texcode>
 
=== Defining derivative colors ===
 
Colors defined in terms of other colors are processed at the Lua end, unless they are direct clones. In that case, the new name is never told to Lua. That means that this does not work:
<texcode>
% direct clone, processed by TeX
\definecolor[ColorA][red]
% fails, ColorA not known to Lua
\definecolor[ColorB][.5(ColorA)]
</texcode>
 
Writing it as a fake fraction works.
 
<texcode>
% definition involves a fraction, processed by Lua.
\definecolor[ColorA][1.0(red)]
% succeeds
\definecolor[ColorB][.5(ColorA)]
</texcode>
== Example ==
<context source=yes mode=mkiv>% rgb\definecolor[bluu][r=.25, g=.1, b=1]Hey, \color[bluu]{look at that!-- Please fill in an example if } % hex\definecolor[salmon][x=AB5757]Hey, \color[salmon]{look at that!} \definecolor[brightorange][c=0, m=.4325, y=.9286, k=.0118]Hey, \color[brightorange]{orange you can --glad I didn't say banana?} \definecolor[darknavy][c=.9753, m=.4444, y=0, k=.6824]Hey, \color[darknavy]{is this dark navy?}</context>
== See also ==
<!-- something like * [[cmd:goto|\gotoColor]] -->[[Colors]], [[Command/* {{cmd|definetransparency]]}}
== Help from ConTeXt-Mailinglist/Forum ==
All issues with:
{{Forum|{{SUBPAGENAME}}}}
[[Category:CommandsCommand/Colors|definecolor]]

Navigation menu