Changes

Jump to navigation Jump to search
60 bytes removed ,  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>
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
== 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}
<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]
\usemodule[mathfun]
\def\RED{\mathexpr[.3N]{\getvariable{ColorName}{r}/255}}
\def\GREEN{\mathexpr[.3N]{\getvariable{ColorName}{g}/255}}
\def\BLUE{\mathexpr[.3N]{\getvariable{ColorName}{b}/255}}
% Define the actual color based on variables:
\definecolor[ColorName][% r={\REDmathexpr[.3N]{\getvariable{ColorName}{r}/255}}, g={\mathexpr[.3N]{\GREENgetvariable{ColorName}{g}/255}}, b={\BLUEmathexpr[.3N]{\getvariable{ColorName}{b}/255}},]%
% Test it:
\startTEXpage[offset=5mm]
Hello \framed[foregroundcolor=white, background=color,backgroundcolor=ColorName]{Hello WORLD!}! \\Red: \RED\\Green: \GREEN\\Blue: \BLUEcolorcomponents{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]
\usemodule[mathfun]
\def\RED{\mathexpr[.3N]{\getvariable{ColorName}{r}/255}}
\def\GREEN{\mathexpr[.3N]{\getvariable{ColorName}{g}/255}}
\def\BLUE{\mathexpr[.3N]{\getvariable{ColorName}{b}/255}}
% Define the actual color based on variables:
\definecolor[ColorName][% r={\REDmathexpr[.3N]{\getvariable{ColorName}{r}/255}}, g={\mathexpr[.3N]{\GREENgetvariable{ColorName}{g}/255}}, b={\BLUEmathexpr[.3N]{\getvariable{ColorName}{b}/255}},]%
% Test it:
\startTEXpage[offset=5mm]
Hello \framed[foregroundcolor=white, background=color,backgroundcolor=ColorName]{Hello WORLD!}! \\Red: \RED\\Green: \GREEN\\Blue: \BLUEcolorcomponents{ColorName}
\stopTEXpage
</context>
* [[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