Changes

Jump to navigation Jump to search
2,446 bytes added ,  11:44, 22 October 2012
→‎Using predefined colors: {{cmd|setupcolor}}: expanded info on predefined sets
== Using predefined colors: {{cmd|setupcolor}} ==
You find lists Colors have identifiers, some of predefined colors which are grouped in more or lesswidely known sets. The primary example of these possibly are the files <tt>colo-xxx[http://www.w3.tex<org/TR/2002/tt>, load them with {{cmd|setupcolor}}<tt>[xxx]<WD-css3-color-20020219/tt>:* rgb: some simple #x11-color named colorsof the X Windowing System], loaded by default (with translations for a set of RGB vectors.With the growth of the different interface languages!)WWW this list of definitions eventually achieved* xwi: X-Windows-the rank of the default ''Web colors''.* pra: PRAGMA ADE company For convenience the X11 colors, along with a couple others, are* ema: Emacs colorspre-defined in Context in the form of a loadable module.
* Try ''NB'': there are two sets representing the magic web colors:<code>xwi</code> and <code>x11</code>. The main difference between themis that the latter defines variations for many keywords.For instance, instead of having only one color ''deepskyblue'' with<code>xwi</code>, you get another four colors ''deepskyblue1'',''deepskyblue2'' ''deepskyblue3'' and ''deepskyblue4'' with the<code>x11</code> set.(Another technical aspect is that the latter are specified usinghexadecimal RGB values whereas the former rely on decimal values.) To use them and any of the others listed below, pass the respectivedefinition identifier to {{cmd|showcolorsetupcolor}}: <tttexcode>\setupcolor[xxxx11]</tttexcode>! For example, The macro {{cmd|showcolor}} pretty prints a the list of all namedcolors in a definition set. <context mode="mkiv" source="yes" text="yields several pages of this:">\setupcolors[state=start]
\showcolor[rgb]
</context>
 
=== MkIV ===
 
The definitions reside in the files prefixed <code>colo-imp-</code>, to
separate them from the color functionality that is implemented in
<code>colo-xxx.mkiv</code>.
 
{|
! id !! source !! description
|-
| rgb || {{src|colo-imp-rgb.mkiv}} || some simple colors, loaded by default (with translations for the different interface languages!)
|-
| xwi || {{src|colo-imp-xwi.mkiv}}
| Xorg color keywords (WWW), defined in decimal RGB
|-
| x11 || {{src|colo-imp-x11.mkiv}}
| extended Xorg color keywords (WWW), defined in hex RGB
|-
| ema || {{src|colo-imp-ema.mkiv}} || Emacs colors
|-
| dem || {{src|colo-imp-dem.mkiv}}
| color groups and palets for different language interfaces
|}
 
=== MkII ===
 
You will find lists of predefined colors in the files
<tt>colo-xxx.mkii</tt>, load them with
{{cmd|setupcolor}}<tt>[xxx]</tt>.
{|
! id !! source !! description
|-
| rgb || {{src|colo-rgb.mkii}} || some simple colors, loaded by default (with translations for the different interface languages!)
|-
| x11 || {{src|colo-x11.mkii}} || Xorg-colors (hex)
|-
| xwi || {{src|colo-xwi.mkii}} || Xorg-colors (decimal)
|-
| pra || {{src|colo-???.mkii|link=no}}
| PRAGMA ADE corporate design (not included in the distribution?)
|-
| ema || {{src|colo-ema.mkii}} || Emacs colors
|}
 
=== Alternatives ===
 
You can generate an alternative definition set based on the results of
the [http://blog.xkcd.com/2010/05/03/color-survey-results/ xkcd color survey]
with the
[https://bitbucket.org/phg/xcs-colors <code>xcs-colors.lua</code> script].
== Defining colors: {{cmd|definecolor}} ==
188

edits

Navigation menu