Changes

Jump to navigation Jump to search
1,440 bytes added ,  14:27, 30 July 2023
simplify some examples, small additions
</texcode>
|
|<context mode=mkiv>\starttext
Three \color[red]{cool} cats
\stoptext
</context>
|}
</texcode>
|
|<context mode=mkiv>\starttext
Three \colored[r=0.1, g=0.8, b=0.8]{colorful} cats
\stoptext
</context>
|}
|-
|<texcode>\setupcolors[textcolor=blue]
\starttext\input samplefile{tufte \stoptext}
</texcode>
|
|<context mode=mkiv>
\setupcolors[textcolor=blue]
\startTEXpage
\input tufte
\stopTEXpage
</context>
|}
\starttext
\input samplefile{ward}
\stoptext
</context>
* [https://en.wikipedia.org/wiki/CMYK_color_model CMYK], typically used for printing
* [https://en.wikipedia.org/wiki/RGB_color_model RGB], [https://en.wikipedia.org/wiki/HSL_and_HSV HSV/HSL] and [https://en.wikipedia.org/wiki/HWB_color_model HWB], typically used for screen display,
* [[Transparency]] ([https://en.wikipedia.org/wiki/Transparency_(graphic) TransparenciesTransparency] on wikipedia).* [[Spot Colors]] typically used for offset printing ([https://en.wikipedia.org/wiki/Spot_color Spot colors]] on wikipedia).
New colors may be defined in the following ways
background=color, backgroundcolor=highlight]
This is a an \important{important}word.
\definecolor[highlight][lavenderblush]
background=color, backgroundcolor=highlight]
This is a an \important{important}word.
\definecolor[highlight][lavenderblush]
This is a an \important{important}word.
</context>
|}
RAL color system (Deutsches Institut für Gütesicherung und Kennzeichnung)
approximate RGB colors (inofficial translation from [http://www.ralcolor.com www.ralcolor.com]). These are defined in {{src|colo-imp-ral.mkiv}} and can be loaded using
<texcode>\usecolors[ral]</texcode>
== Solarized colors ==
Colors based on the [http://ethanschoonover.com/solarized Solarized] color schemeby Ethan Schoonover.
These are defined in {{src|colo-imp-solarized.mkiv}} and can be loaded using
|mistyrose||bgcolor="ffe4e1" | &nbsp;
|white||bgcolor="ffffff" | &nbsp;
|black||bgcolor="000000" | & nbs[nbsp;
|darkslategray||bgcolor="2f4f4f" | &nbsp;
|-
|lightseagreen||bgcolor="20b2aa" | &nbsp;
|palegreen||bgcolor="98fb98" | &nbsp;
|lightgreen||bgcolor="90ee90" | & nbsp;
|-
|springgreen||bgcolor="00ff7f" | &nbsp;
|darkcyan||bgcolor="008b8b" | &nbsp;
|-
|darkmagenta||bgcolor="8b008b" | & nbsp;|darkred||bgcolor="8b000000" | & nbsp;
|darkgreen||bgcolor="006400" | &nbsp;
|}
 
 
== XWI Colors ==
== Using colors in MetaPost ==
A color defined in TeX is available in MetaPost using `\MPcolor{...}`or in LuaMetaFun simply the name in quotation marks. For example:
{|
|<context mode=mkiv>
\definecolor[highlight][r=0.8,g=0.8,b=0]
\starttext
\color[highlight]{Highlighted text in TeX}
|}
= Tips and Tricks =
 
== Calculating RGB Values ==
 
An example of how to use LMTX to calculate RGB values is the following:
 
<texcode>
% Use a color picker to get red, green and blue values of a color:
% Example: RAL 2005: red = 255, green = 35, blue = 1
% Create variables from the values:
 
\setvariables[ColorName][r=255,g=35,b=1]
 
% Do some magic:
 
\usemodule[mathfun]
 
% Define the actual color based on variables:
 
\definecolor[ColorName][%
r={\mathexpr[.3N]{\getvariable{ColorName}{r}/255}},
g={\mathexpr[.3N]{\getvariable{ColorName}{g}/255}},
b={\mathexpr[.3N]{\getvariable{ColorName}{b}/255}},
]%
 
% Test it:
 
\startTEXpage[offset=5mm]
\framed[foregroundcolor=white, background=color, backgroundcolor=ColorName]{Hello WORLD!}
\\\colorcomponents{ColorName}
\stopTEXpage
</texcode>
 
<context>
% Use a color picker to get red, green and blue values of a color:
% Example: RAL 2005: red = 255, green = 35, blue = 1
% Create variables from the values:
 
\setvariables[ColorName][r=255,g=35,b=1]
 
% Do some magic:
 
\usemodule[mathfun]
 
% Define the actual color based on variables:
 
\definecolor[ColorName][%
r={\mathexpr[.3N]{\getvariable{ColorName}{r}/255}},
g={\mathexpr[.3N]{\getvariable{ColorName}{g}/255}},
b={\mathexpr[.3N]{\getvariable{ColorName}{b}/255}},
]%
 
% Test it:
 
\startTEXpage[offset=5mm]
\framed[foregroundcolor=white, background=color, backgroundcolor=ColorName]{Hello WORLD!}
\\\colorcomponents{ColorName}
\stopTEXpage
</context>
= Further reading and specialized topics =
* [[Spot Colors]]
* References
** [http://paletton.com Paletton] - Website website to choose color palettes** [http://colorbrewer2.org/ ColorBrewer] - website to choose colors for maps and graphics.** Tina Sutton, Bride M Whelan: The Complete Color Harmony. Rockport Publishers (2004). ISBN 978-1592530311 (recommanded recommended in the mailing list)
[[Category:Color]]
[[Category:Graphics]]

Navigation menu