Difference between revisions of "Color"
m (→X11 Colors: Added Crayola Colors) |
|||
Line 315: | Line 315: | ||
|yellow||bgcolor="#FFFF00"| | |yellow||bgcolor="#FFFF00"| | ||
|yellowgreen||bgcolor="#99CC33"| | |yellowgreen||bgcolor="#99CC33"| | ||
+ | |} | ||
+ | |||
+ | == Crayola crayon colors == | ||
+ | |||
+ | The following colors are defined in {{src|colo-imp-crayola.mkiv}}. These can | ||
+ | be loaded using | ||
+ | |||
+ | <texcode>\usecolors[crayola]</texcode> | ||
+ | |||
+ | |||
+ | {| style="text-align: right; padding-right: 20px;" | ||
+ | !| Name !! Color | ||
+ | !style="width: 100px;"| Name !! Color | ||
+ | !style="width: 100px;"| Name !! Color | ||
+ | !style="width: 100px;"| Name !! Color | ||
+ | |- | ||
+ | |Red||bgcolor="ED0A3F" | | ||
+ | |Maroon||bgcolor="C32148" | | ||
+ | |Scarlet||bgcolor="FD0E35" | | ||
+ | |BrickRed||bgcolor="C62D42" | | ||
+ | |- | ||
+ | |EnglishVermilion||bgcolor="CC474B" | | ||
+ | |MadderLake||bgcolor="CC3336" | | ||
+ | |PermanentGeraniumLake||bgcolor="E12C2C" | | ||
+ | |MaximumRed||bgcolor="D92121" | | ||
+ | |- | ||
+ | |IndianRed||bgcolor="B94E48" | | ||
+ | |OrangeRed||bgcolor="FF5349" | | ||
+ | |SunsetOrange||bgcolor="FE4C40" | | ||
+ | |Bittersweet||bgcolor="FE6F5E" | | ||
+ | |- | ||
+ | |DarkVenetianRed||bgcolor="B33B24" | | ||
+ | |VenetianRed||bgcolor="CC553D" | | ||
+ | |LightVenetianRed||bgcolor="E6735C" | | ||
+ | |VividTangerine||bgcolor="FF9980" | | ||
+ | |- | ||
+ | |MiddleRed||bgcolor="E58E73" | | ||
+ | |BurntOrange||bgcolor="FF7F49" | | ||
+ | |RedOrange||bgcolor="FF681F" | | ||
+ | |Orange||bgcolor="FF8833" | | ||
+ | |- | ||
+ | |MacaroniandCheese||bgcolor="FFB97B" | | ||
+ | |MiddleYellowRed||bgcolor="ECB176" | | ||
+ | |MangoTango||bgcolor="E77200" | | ||
+ | |YellowOrange||bgcolor="FFAE42" | | ||
+ | |- | ||
+ | |MaximumYellowRed||bgcolor="F2BA49" | | ||
+ | |BananaMania||bgcolor="FBE7B2" | | ||
+ | |Maize||bgcolor="F2C649" | | ||
+ | |OrangeYellow||bgcolor="F8D568" | | ||
+ | |- | ||
+ | |Goldenrod||bgcolor="FCD667" | | ||
+ | |Dandelion||bgcolor="FED85D" | | ||
+ | |Yellow||bgcolor="FBE870" | | ||
+ | |GreenYellow||bgcolor="F1E788" | | ||
+ | |- | ||
+ | |MiddleYellow||bgcolor="FFEB00" | | ||
+ | |OliveGreen||bgcolor="B5B35C" | | ||
+ | |SpringGreen||bgcolor="ECEBBD" | | ||
+ | |MaximumYellow||bgcolor="FAFA37" | | ||
+ | |- | ||
+ | |Canary||bgcolor="FFFF99" | | ||
+ | |LemonYellow||bgcolor="FFFF9F" | | ||
+ | |MaximumGreenYellow||bgcolor="D9E650" | | ||
+ | |MiddleGreenYellow||bgcolor="ACBF60" | | ||
+ | |- | ||
+ | |Inchworm||bgcolor="AFE313" | | ||
+ | |LightChromeGreen||bgcolor="BEE64B" | | ||
+ | |YellowGreen||bgcolor="C5E17A" | | ||
+ | |MaximumGreen||bgcolor="5E8C31" | | ||
+ | |- | ||
+ | |Asparagus||bgcolor="7BA05B" | | ||
+ | |GrannySmithApple||bgcolor="9DE093" | | ||
+ | |Fern||bgcolor="63B76C" | | ||
+ | |MiddleGreen||bgcolor="4D8C57" | | ||
+ | |- | ||
+ | |Green||bgcolor="3AA655" | | ||
+ | |MediumChromeGreen||bgcolor="6CA67C" | | ||
+ | |ForestGreen||bgcolor="5FA777" | | ||
+ | |SeaGreen||bgcolor="93DFB8" | | ||
+ | |- | ||
+ | |Shamrock||bgcolor="33CC99" | | ||
+ | |MountainMeadow||bgcolor="1AB385" | | ||
+ | |JungleGreen||bgcolor="29AB87" | | ||
+ | |CaribbeanGreen||bgcolor="00CC99" | | ||
+ | |- | ||
+ | |TropicalRainForest||bgcolor="00755E" | | ||
+ | |MiddleBlueGreen||bgcolor="8DD9CC" | | ||
+ | |PineGreen||bgcolor="01786F" | | ||
+ | |MaximumBlueGreen||bgcolor="30BFBF" | | ||
+ | |- | ||
+ | |RobinsEggBlue||bgcolor="00CCCC" | | ||
+ | |TealBlue||bgcolor="008080" | | ||
+ | |LightBlue||bgcolor="8FD8D8" | | ||
+ | |Aquamarine||bgcolor="95E0E8" | | ||
+ | |- | ||
+ | |TurquoiseBlue||bgcolor="6CDAE7" | | ||
+ | |OuterSpace||bgcolor="2D383A" | | ||
+ | |SkyBlue||bgcolor="76D7EA" | | ||
+ | |MiddleBlue||bgcolor="7ED4E6" | | ||
+ | |- | ||
+ | |BlueGreen||bgcolor="0095B7" | | ||
+ | |PacificBlue||bgcolor="009DC4" | | ||
+ | |Cerulean||bgcolor="02A4D3" | | ||
+ | |MaximumBlue||bgcolor="47ABCC" | | ||
+ | |- | ||
+ | |BlueI||bgcolor="4997D0" | | ||
+ | |CeruleanBlue||bgcolor="339ACC" | | ||
+ | |Cornflower||bgcolor="93CCEA" | | ||
+ | |GreenBlue||bgcolor="2887C8" | | ||
+ | |- | ||
+ | |MidnightBlue||bgcolor="00468C" | | ||
+ | |NavyBlue||bgcolor="0066CC" | | ||
+ | |Denim||bgcolor="1560BD" | | ||
+ | |BlueIII||bgcolor="0066FF" | | ||
+ | |- | ||
+ | |CadetBlue||bgcolor="A9B2C3" | | ||
+ | |Periwinkle||bgcolor="C3CDE6" | | ||
+ | |BlueII||bgcolor="4570E6" | | ||
+ | |WildBlueYonder||bgcolor="7A89B8" | | ||
+ | |- | ||
+ | |Indigo||bgcolor="4F69C6" | | ||
+ | |Manatee||bgcolor="8D90A1" | | ||
+ | |CobaltBlue||bgcolor="8C90C8" | | ||
+ | |CelestialBlue||bgcolor="7070CC" | | ||
+ | |- | ||
+ | |BlueBell||bgcolor="9999CC" | | ||
+ | |MaximumBluePurple||bgcolor="ACACE6" | | ||
+ | |VioletBlue||bgcolor="766EC8" | | ||
+ | |BlueViolet||bgcolor="6456B7" | | ||
+ | |- | ||
+ | |UltramarineBlue||bgcolor="3F26BF" | | ||
+ | |MiddleBluePurple||bgcolor="8B72BE" | | ||
+ | |PurpleHeart||bgcolor="652DC1" | | ||
+ | |RoyalPurple||bgcolor="6B3FA0" | | ||
+ | |- | ||
+ | |VioletII||bgcolor="8359A3" | | ||
+ | |MediumViolet||bgcolor="8F47B3" | | ||
+ | |Wisteria||bgcolor="C9A0DC" | | ||
+ | |LavenderI||bgcolor="BF8FCC" | | ||
+ | |- | ||
+ | |VividViolet||bgcolor="803790" | | ||
+ | |MaximumPurple||bgcolor="733380" | | ||
+ | |PurpleMountainsMajesty||bgcolor="D6AEDD" | | ||
+ | |Fuchsia||bgcolor="C154C1" | | ||
+ | |- | ||
+ | |PinkFlamingo||bgcolor="FC74FD" | | ||
+ | |VioletI||bgcolor="732E6C" | | ||
+ | |BrilliantRose||bgcolor="E667CE" | | ||
+ | |Orchid||bgcolor="E29CD2" | | ||
+ | |- | ||
+ | |Plum||bgcolor="8E3179" | | ||
+ | |MediumRose||bgcolor="D96CBE" | | ||
+ | |Thistle||bgcolor="EBB0D7" | | ||
+ | |Mulberry||bgcolor="C8509B" | | ||
+ | |- | ||
+ | |RedViolet||bgcolor="BB3385" | | ||
+ | |MiddlePurple||bgcolor="D982B5" | | ||
+ | |MaximumRedPurple||bgcolor="A63A79" | | ||
+ | |JazzberryJam||bgcolor="A50B5E" | | ||
+ | |- | ||
+ | |Eggplant||bgcolor="614051" | | ||
+ | |Magenta||bgcolor="F653A6" | | ||
+ | |Cerise||bgcolor="DA3287" | | ||
+ | |WildStrawberry||bgcolor="FF3399" | | ||
+ | |- | ||
+ | |LavenderII||bgcolor="FBAED2" | | ||
+ | |CottonCandy||bgcolor="FFB7D5" | | ||
+ | |CarnationPink||bgcolor="FFA6C9" | | ||
+ | |VioletRed||bgcolor="F7468A" | | ||
+ | |- | ||
+ | |Razzmatazz||bgcolor="E30B5C" | | ||
+ | |PigPink||bgcolor="FDD7E4" | | ||
+ | |Carmine||bgcolor="E62E6B" | | ||
+ | |Blush||bgcolor="DB5079" | | ||
+ | |- | ||
+ | |TickleMePink||bgcolor="FC80A5" | | ||
+ | |Mauvelous||bgcolor="F091A9" | | ||
+ | |Salmon||bgcolor="FF91A4" | | ||
+ | |MiddleRedPurple||bgcolor="A55353" | | ||
+ | |- | ||
+ | |Mahogany||bgcolor="CA3435" | | ||
+ | |Melon||bgcolor="FEBAAD" | | ||
+ | |PinkSherbert||bgcolor="F7A38E" | | ||
+ | |BurntSienna||bgcolor="E97451" | | ||
+ | |- | ||
+ | |Brown||bgcolor="AF593E" | | ||
+ | |Sepia||bgcolor="9E5B40" | | ||
+ | |FuzzyWuzzy||bgcolor="87421F" | | ||
+ | |Beaver||bgcolor="926F5B" | | ||
+ | |- | ||
+ | |Tumbleweed||bgcolor="DEA681" | | ||
+ | |RawSienna||bgcolor="D27D46" | | ||
+ | |VanDykeBrown||bgcolor="664228" | | ||
+ | |Tan||bgcolor="D99A6C" | | ||
+ | |- | ||
+ | |DesertSand||bgcolor="EDC9AF" | | ||
+ | |Peach||bgcolor="FFCBA4" | | ||
+ | |BurntUmber||bgcolor="805533" | | ||
+ | |Apricot||bgcolor="FDD5B1" | | ||
+ | |- | ||
+ | |Almond||bgcolor="EED9C4" | | ||
+ | |RawUmber||bgcolor="665233" | | ||
+ | |Shadow||bgcolor="837050" | | ||
+ | |RawSiennaI||bgcolor="E6BC5C" | | ||
+ | |- | ||
+ | |Timberwolf||bgcolor="D9D6CF" | | ||
+ | |GoldI||bgcolor="92926E" | | ||
+ | |GoldII||bgcolor="E6BE8A" | | ||
+ | |Silver||bgcolor="C9C0BB" | | ||
+ | |- | ||
+ | |Copper||bgcolor="DA8A67" | | ||
+ | |AntiqueBrass||bgcolor="C88A65" | | ||
+ | |Black||bgcolor="000000" | | ||
+ | |CharcoalGray||bgcolor="736A62" | | ||
+ | |- | ||
+ | |Gray||bgcolor="8B8680" | | ||
+ | |BlueGray||bgcolor="C8C8CD" | | ||
+ | |White||bgcolor="FFFFFF" | | ||
+ | |RadicalRed||bgcolor="FF355E" | | ||
+ | |- | ||
+ | |WildWatermelon||bgcolor="FD5B78" | | ||
+ | |OutrageousOrange||bgcolor="FF6037" | | ||
+ | |AtomicTangerine||bgcolor="FF9966" | | ||
+ | |NeonCarrot||bgcolor="FF9933" | | ||
+ | |- | ||
+ | |Sunglow||bgcolor="FFCC33" | | ||
+ | |LaserLemon||bgcolor="FFFF66" | | ||
+ | |UnmellowYellow||bgcolor="FFFF66" | | ||
+ | |ElectricLime||bgcolor="CCFF00" | | ||
+ | |- | ||
+ | |ScreaminGreen||bgcolor="66FF66" | | ||
+ | |MagicMint||bgcolor="AAF0D1" | | ||
+ | |BlizzardBlue||bgcolor="50BFE6" | | ||
+ | |ShockingPink||bgcolor="FF6EFF" | | ||
+ | |- | ||
+ | |RazzleDazzleRose||bgcolor="EE34D2" | | ||
+ | |HotMagenta||bgcolor="FF00CC" | | ||
+ | |PurplePizzazz||bgcolor="FF00CC" | | ||
+ | |AztecGold||bgcolor="C39953" | | ||
+ | |- | ||
+ | |BurnishedBrown||bgcolor="A17A74" | | ||
+ | |CeruleanFrost||bgcolor="6D9BC3" | | ||
+ | |CinnamonSatin||bgcolor="CD607E" | | ||
+ | |CopperPenny||bgcolor="AD6F69" | | ||
+ | |- | ||
+ | |CosmicCobalt||bgcolor="2E2D88" | | ||
+ | |GlossyGrape||bgcolor="AB92B3" | | ||
+ | |GraniteGray||bgcolor="676767" | | ||
+ | |GreenSheen||bgcolor="6EAEA1" | | ||
+ | |- | ||
+ | |LilacLuster||bgcolor="AE98AA" | | ||
+ | |MistyMoss||bgcolor="BBB477" | | ||
+ | |MysticMaroon||bgcolor="AD4379" | | ||
+ | |PearlyPurple||bgcolor="B768A2" | | ||
+ | |- | ||
+ | |PewterBlue||bgcolor="8BA8B7" | | ||
+ | |PolishedPine||bgcolor="5DA493" | | ||
+ | |QuickSilver||bgcolor="A6A6A6" | | ||
+ | |RoseDust||bgcolor="9E5E6F" | | ||
+ | |- | ||
+ | |RustyRed||bgcolor="DA2C43" | | ||
+ | |ShadowBlue||bgcolor="778BA5" | | ||
+ | |ShinyShamrock||bgcolor="5FA778" | | ||
+ | |SteelTeal||bgcolor="5F8A8B" | | ||
+ | |- | ||
+ | |SugarPlum||bgcolor="914E75" | | ||
+ | |TwilightLavender||bgcolor="8A496B" | | ||
+ | |WintergreenDream||bgcolor="56887D" | | ||
+ | |Amethyst||bgcolor="64609A" | | ||
+ | |- | ||
+ | |Citrine||bgcolor="933709" | | ||
+ | |Emerald||bgcolor="14A989" | | ||
+ | |Jade||bgcolor="469A84" | | ||
+ | |Jasper||bgcolor="D05340" | | ||
+ | |- | ||
+ | |LapisLazuli||bgcolor="436CB9" | | ||
+ | |Malachite||bgcolor="469496" | | ||
+ | |Moonstone||bgcolor="3AA8C1" | | ||
+ | |Onyx||bgcolor="353839" | | ||
+ | |- | ||
+ | |Peridot||bgcolor="ABAD48" | | ||
+ | |PinkPearl||bgcolor="B07080" | | ||
+ | |RoseQuartz||bgcolor="BD559C" | | ||
+ | |Ruby||bgcolor="AA4069" | | ||
+ | |- | ||
+ | |Sapphire||bgcolor="2D5DA1" | | ||
+ | |SmokeyTopaz||bgcolor="832A0D" | | ||
+ | |TigersEye||bgcolor="B56917" | | ||
+ | |AquaPearl||bgcolor="5FBED7" | | ||
+ | |- | ||
+ | |BlackCoralPearl||bgcolor="54626F" | | ||
+ | |CaribbeanGreenPearl||bgcolor="6ADA8E" | | ||
+ | |CulturedPearl||bgcolor="F5F5F5" | | ||
+ | |KeyLimePearl||bgcolor="E8F48C" | | ||
+ | |- | ||
+ | |MandarinPearl||bgcolor="F37A48" | | ||
+ | |MidnightPearl||bgcolor="702670" | | ||
+ | |MysticPearl||bgcolor="D65282" | | ||
+ | |OceanBluePearl||bgcolor="4F42B5" | | ||
+ | |- | ||
+ | |OceanGreenPearl||bgcolor="48BF91" | | ||
+ | |OrchidPearl||bgcolor="7B4259" | | ||
+ | |RosePearl||bgcolor="F03865" | | ||
+ | |SalmonPearl||bgcolor="F1444A" | | ||
+ | |- | ||
+ | |SunnyPearl||bgcolor="F2F27A" | | ||
+ | |SunsetPearl||bgcolor="F1CC79" | | ||
|} | |} | ||
Revision as of 04:15, 8 June 2020
-
- Overview
- Color
- Color in MetaPost
-
- Cmd general
- \color
- \MPcolor
- \definecolor
- \setupcolors
- \showcolor
- \usecolor
-
- Cmd Logical palettes
- \definepalet
- \setuppalet
- \showpalet
- \comparepalet
-
- Grps of similar colors
- \definecolorgroup
- \showcolorgroup
-
- Src MkIV color def
- colo-imp-dem.mkiv
- colo-imp-rgb.mkiv
- colo-imp-xwi.mkiv
- colo-imp-ema.mkiv
- colo-imp-x11.mkiv
Contents
Before you start ...
1. It’s usually bad style to use explicit color switches in the text. It’s better to define a semantic command that takes care of the color switching. For example, instead of using \color[red]{important text}
, define
\definehighlight[important][color=red]
and then use \important{important text}
in the text.
2. Colors are not enabled by default in MkII. To enable colors in MkII, use
\setupcolors[state=start]
3. To disable colors in a document, use
\setupcolors[state=stop]
Last manual dedicated to color was issued in 2016
Basic Usage
To color text, use
\color[defined-color]{ ... text ... }
or
\startcolor[defined-color] ... text ... \stopcolor
where defined-color
is a color defined using \definecolor. For example, red
is one of the predefined colors. So, we can use:
Three \color[red]{cool} cats |
or
\startcolor[red] \input tufte \stopcolor
It is also possible to use RGB or CMYK or hex values to color text. The syntax for these is
\colored[settings]{... text ...}
where settings
are the same settings as used by \definecolor. For example:
Three \colored[r=0.1, g=0.8, b=0.8]{colorful} cats |
Note. There is no need to use the color commands directly. Almost all ConTeXt commands accept a color
key, and you can use color=defined-color
. For example,
- To color the section titles red, use
\setuphead[color=red]
- To color the footnotes red, use
\setupfootnotes[color=red]
etc.
Pre-defined colors
Default pre-defined colors
The following colors are pre-defined in ConTeXt (see colo-imp-rgb.mkiv).
Name | Color | Name | Color | Name | Color | Name | Color |
---|---|---|---|---|---|---|---|
black | white | ||||||
gray | lightgray | middlegray | darkgray | ||||
red | lightred | middlered | darkred | ||||
green | lightgreen | middlegreen | darkgreen | ||||
blue | lightblue | middleblue | darkblue | ||||
cyan | middlecyan | darkcyan | |||||
magenta | middlemagenta | darkmagenta | |||||
yellow | middleyellow | darkyellow |
X11 Colors
In addition to the above basic color, ConTeXt also includes a definition of the X11 colors. To load this list (colo-imp-xwi.mkiv), use
\usecolors[xwi]
This loads the following additional colors:
Name | Color | Name | Color | Name | Color | Name | Color |
---|---|---|---|---|---|---|---|
aliceblue | antiquewhite | aquamarine | azure | ||||
beige | bisque | black | blanchedalmond | ||||
blue | blueviolet | brown | burlywood | ||||
cadetblue | chartreuse | chocolate | coral | ||||
cornflowerblue | cornsilk | cyan | darkgoldenrod | ||||
darkgreen | darkkhaki | darkolivegreen | darkorange | ||||
darkorchid | darksalmon | darkseagreen | darkslateblue | ||||
darkturquoise | darkviolet | deeppink | deepskyblue | ||||
dodgerblue | firebrick | floralwhite | forestgreen | ||||
gainsboro | ghostwhite | gold | goldenrod | ||||
green | greenyellow | honeydew | hotpink | ||||
indianred | ivory | khaki | lavender | ||||
lavenderblush | lawngreen | lemonchiffon | lightblue | ||||
lightcoral | lightcyan | lightgoldenrod | lightgoldenrodyellow | ||||
lightpink | lightsalmon | lightseagreen | lightskyblue | ||||
lightslateblue | lightsteelblue | lightyellow | limegreen | ||||
linen | magenta | maroon | mediumaquamarine | ||||
mediumblue | mediumorchid | mediumpurple | mediumseagreen | ||||
mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | ||||
midnightblue | mintcream | mistyrose | moccasin | ||||
navajowhite | navy | navyblue | oldlace | ||||
olivedrab | orange | orangered | orchid | ||||
palegoldenrod | palegreen | paleturquoise | palevioletred | ||||
papayawhip | peachpuff | peru | pink | ||||
plum | powderblue | purple | red | ||||
rosybrown | royalblue | saddlebrown | salmon | ||||
sandybrown | seagreen | seashell | sienna | ||||
skyblue | slateblue | snow | springgreen | ||||
steelblue | tan | thistle | tomato | ||||
turquoise | violet | violetred | wheat | ||||
white | whitesmoke | yellow | yellowgreen |
Crayola crayon colors
The following colors are defined in colo-imp-crayola.mkiv. These can be loaded using
\usecolors[crayola]
Name | Color | Name | Color | Name | Color | Name | Color |
---|---|---|---|---|---|---|---|
Red | Maroon | Scarlet | BrickRed | ||||
EnglishVermilion | MadderLake | PermanentGeraniumLake | MaximumRed | ||||
IndianRed | OrangeRed | SunsetOrange | Bittersweet | ||||
DarkVenetianRed | VenetianRed | LightVenetianRed | VividTangerine | ||||
MiddleRed | BurntOrange | RedOrange | Orange | ||||
MacaroniandCheese | MiddleYellowRed | MangoTango | YellowOrange | ||||
MaximumYellowRed | BananaMania | Maize | OrangeYellow | ||||
Goldenrod | Dandelion | Yellow | GreenYellow | ||||
MiddleYellow | OliveGreen | SpringGreen | MaximumYellow | ||||
Canary | LemonYellow | MaximumGreenYellow | MiddleGreenYellow | ||||
Inchworm | LightChromeGreen | YellowGreen | MaximumGreen | ||||
Asparagus | GrannySmithApple | Fern | MiddleGreen | ||||
Green | MediumChromeGreen | ForestGreen | SeaGreen | ||||
Shamrock | MountainMeadow | JungleGreen | CaribbeanGreen | ||||
TropicalRainForest | MiddleBlueGreen | PineGreen | MaximumBlueGreen | ||||
RobinsEggBlue | TealBlue | LightBlue | Aquamarine | ||||
TurquoiseBlue | OuterSpace | SkyBlue | MiddleBlue | ||||
BlueGreen | PacificBlue | Cerulean | MaximumBlue | ||||
BlueI | CeruleanBlue | Cornflower | GreenBlue | ||||
MidnightBlue | NavyBlue | Denim | BlueIII | ||||
CadetBlue | Periwinkle | BlueII | WildBlueYonder | ||||
Indigo | Manatee | CobaltBlue | CelestialBlue | ||||
BlueBell | MaximumBluePurple | VioletBlue | BlueViolet | ||||
UltramarineBlue | MiddleBluePurple | PurpleHeart | RoyalPurple | ||||
VioletII | MediumViolet | Wisteria | LavenderI | ||||
VividViolet | MaximumPurple | PurpleMountainsMajesty | Fuchsia | ||||
PinkFlamingo | VioletI | BrilliantRose | Orchid | ||||
Plum | MediumRose | Thistle | Mulberry | ||||
RedViolet | MiddlePurple | MaximumRedPurple | JazzberryJam | ||||
Eggplant | Magenta | Cerise | WildStrawberry | ||||
LavenderII | CottonCandy | CarnationPink | VioletRed | ||||
Razzmatazz | PigPink | Carmine | Blush | ||||
TickleMePink | Mauvelous | Salmon | MiddleRedPurple | ||||
Mahogany | Melon | PinkSherbert | BurntSienna | ||||
Brown | Sepia | FuzzyWuzzy | Beaver | ||||
Tumbleweed | RawSienna | VanDykeBrown | Tan | ||||
DesertSand | Peach | BurntUmber | Apricot | ||||
Almond | RawUmber | Shadow | RawSiennaI | ||||
Timberwolf | GoldI | GoldII | Silver | ||||
Copper | AntiqueBrass | Black | CharcoalGray | ||||
Gray | BlueGray | White | RadicalRed | ||||
WildWatermelon | OutrageousOrange | AtomicTangerine | NeonCarrot | ||||
Sunglow | LaserLemon | UnmellowYellow | ElectricLime | ||||
ScreaminGreen | MagicMint | BlizzardBlue | ShockingPink | ||||
RazzleDazzleRose | HotMagenta | PurplePizzazz | AztecGold | ||||
BurnishedBrown | CeruleanFrost | CinnamonSatin | CopperPenny | ||||
CosmicCobalt | GlossyGrape | GraniteGray | GreenSheen | ||||
LilacLuster | MistyMoss | MysticMaroon | PearlyPurple | ||||
PewterBlue | PolishedPine | QuickSilver | RoseDust | ||||
RustyRed | ShadowBlue | ShinyShamrock | SteelTeal | ||||
SugarPlum | TwilightLavender | WintergreenDream | Amethyst | ||||
Citrine | Emerald | Jade | Jasper | ||||
LapisLazuli | Malachite | Moonstone | Onyx | ||||
Peridot | PinkPearl | RoseQuartz | Ruby | ||||
Sapphire | SmokeyTopaz | TigersEye | AquaPearl | ||||
BlackCoralPearl | CaribbeanGreenPearl | CulturedPearl | KeyLimePearl | ||||
MandarinPearl | MidnightPearl | MysticPearl | OceanBluePearl | ||||
OceanGreenPearl | OrchidPearl | RosePearl | SalmonPearl | ||||
SunnyPearl | SunsetPearl |
Additional pre-defined colors
In addition to the above, there are other pre-defined colors.
x11 | \usecolors[x11]
|
colo-imp-x11.mkiv | 658 extended Xorg color keywords (WWW), defined in hex RGB |
crayola | \usecolors[crayola]
|
colo-imp-crayola.mkiv | 235 Crayola (Binney & Smith) colors |
ema | \usecolors[ema]
|
colo-imp-ema.mkiv | 549 Emacs colors |
RAL | \usecolors[ral]
|
colo-imp-ral.mkiv | 213 RAL color system (Deutsches Institut für Gütesicherung und Kennzeichnung) |
Solarized | \usecolors[solarized]
|
colo-imp-solarized.mkiv | 16 solarized colors |
Defining New Colors
ConTeXt supports several color models:
- CMYK, typically used for printing
- RGB, HSV/HSL and HWB, typically used for screen display,
- Transparencies,
- Spot colors, typically used for offset printing.
New colors may be defined in the following ways
Name | Syntax (and Example) | Explanation |
---|---|---|
RGB color model | \definecolor[...][r=..., g=..., b=...] For example, \definecolor[lime][r=0.75, g=1, b=0] This is \color[lime]{a new color} that we defined |
The values for r , g , and b are floating point number between 0 and 1 .
|
CMYK color model | \definecolor[...][c=.., m=.., y=.., k=..] For example, \definecolor[lime][c=0.25, m=0, y=1, k=0] This is \color[lime]{a new color} that we defined |
The values for c , m , y and k are floating point number between 0 and 1 .
|
HSV/HSL color model | \definecolor[...][h=.., s=.., v=..] For example, \definecolor[lime][h=75, s=1, v=1] This is \color[lime]{a new color} that we defined |
The value for h (hue) is between 0 and 360 ; the values for s (saturation), v (value/brightness) are floating point numbers between 0 and 1 .
|
HWB color model | \definecolor[...][h=.., w=.., b=..] For example, \definecolor[something][h=75, w=0.5, b=.1] This is \color[something]{a new color} that we defined |
The value for h (hue) is between 0 and 360 ; the values for w (whiteness), b (blackness) are floating point numbers between 0 and 1 . This mostly unknown color model is also used in CSS3/SVG.
|
Hex | \definecolor[...][x=...] For example, \definecolor[lime][x=BFFF00] This is \color[lime]{a new color} that we defined |
The value for x is a three-byte hexadecimal number where the bytes represent the red, green, and blue values. This follows the HTML and CSS style of defining colors.
|
Gray scale | \definecolor[...][s=...] For example, \definecolor[screen][s=0.5] This is \color[screen]{a new color} that we defined |
The value for s is a floating point number between 0 and 1 , representing the grayness value (1 represents white, 0 represents black).
|
Cloning existing colors
You can clone an existing color using
\definecolor[new-color][old-color]
For example
\usecolors[xwi] \definecolor[highlight][yellow] \defineframed [important] [location=low, frame=off, background=color, backgroundcolor=highlight] This is a \important{important}word. \definecolor[highlight][lavenderblush] This is a \important{important}word. |
Adapting existing colors
TODO: add details about this (See: To-Do List) |
Advanced Usage
Changing color of entire document
To change the main text color of the document use
\setupcolors[textcolor=defined-color]
For example,
\setupcolors[textcolor=blue] \starttext text \stoptext |
Changing background color of page
The background color of the page can be changed using
\setupbackgrounds[page][background=color,backgroundcolor=defined-color]
For example,
\setuppapersize[A10] \setupbackgrounds[page][background=color,backgroundcolor=blue] \starttext text \stoptext |
Using colors in MetaPost
A color defined in TeX is available in MetaPost using \MPcolor{...}
. For example:
\definecolor[highlight][r=0.8,g=0.8,b=0] \starttext \color[highlight]{Highlighted text in TeX} \startMPcode label("Highlighted text in MetaPost", origin) withcolor \MPcolor{highlight}; \stopMPcode |
Note that \MPcolor{...}
behaves similar to a color
primitive in MetaPost. For example, the following is valid MetaPost code.
color myColor; myColor = 0.5[\MPcolor{highlight}, white];
For more further reading: Color in MetaPost.
Testing if color is defined
To test if a color is defined, use
Usage:
\doifcolor{color-name}{... if branch ... } \doifcolorelse{color-name}{... if branch ...}{... else branch ...}
Viewing pre-defined color
View all defined colors
To view pre-defined colors, you can use \showcolor. For example, to see all the colors defined in colo-imp-x11.mkiv, use (output truncated for display here ...)
\showcolor[x11] |
If you use \showcolor without any argument, all currently defined colors are shown.
View specific defined colors
To view the components of a defined color, you can use:
\showcolorcomponents[color-1, color-2]
For example,
\showcolorcomponents[red,middlered,darkred] |
\colorcompoents{defined-color} \tranparencycomponents{defined-color} \processcolorcomponents{defined-color}
For example,
\startlines \colorcomponents{red} \transparencycomponents{red} \processcolorcomponents{red} \stoplines |
|
Further reading and specialized topics
- Color Palettes
- Transparency
- Spot Colors
- References
- Paletton - Website to choose color palettes
- 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 in the mailing list)