Difference between revisions of "Color"

From Wiki
Jump to navigation Jump to search
m (added hints to colorgroups, minor changes)
m
Line 1: Line 1:
 
< [[Visuals]] | [[Transparency]] | [[Graphics]] >
 
< [[Visuals]] | [[Transparency]] | [[Graphics]] >
  
==Using Colors===
+
=Using Colors=
  
 
Using colors with ConTeXt is easy:
 
Using colors with ConTeXt is easy:
Line 26: Line 26:
 
Here's some \color[blablue]{blue text} inbetween!
 
Here's some \color[blablue]{blue text} inbetween!
  
\showcolor[pra]
+
\showcolor[rgb]
 
</texcode>
 
</texcode>
 
<context>
 
<context>
Line 34: Line 34:
 
Here's some \color[blablue]{blue text} inbetween!
 
Here's some \color[blablue]{blue text} inbetween!
  
\showcolor[pra]
+
\showcolor[rgb]
 
</context>
 
</context>
  
==Colorgroups and Palettes==
+
=Colorgroups and Palettes=
 
<cmd>definecolorgroup</cmd><tt>[name][system][values]</tt>
 
<cmd>definecolorgroup</cmd><tt>[name][system][values]</tt>
  

Revision as of 17:06, 25 November 2004

< Visuals | Transparency | Graphics >

Using Colors

Using colors with ConTeXt is easy:

  • Start with \setupcolors[state=start]. Without that, everything appears in greys.
  • If you want only RGB or only CMYK color, use cmyk=no or rgb=no. It seems there are also spot and hexachrome colors possible, but I don't know yet how.
  • Normally all colors are defined in RGB and CMYK and get converted if needed.
  • You find lists of predefined colors in the files colo-xxx.tex, load them with \setupcolor[xxx]:
    • rgb: some simple colors, loaded by default (with translations for the different interface languages!)
    • xwi: X-Windows-colors
    • pra: PRAGMA ADE company colors
    • ema: Emacs colors
  • Try the magic \showcolor[xxx]!
  • Define your own colors with \definecolor[blablue][r=.1, g=.1, b=1, c=1, m=.1, y=0, k=0, s=.2] (definition for RGB, CMYK and Grey!)
  • Use the color name like [color=blablue] in some \setup... command.
  • Typeset single text elements with \color[blablue]{nice blue text} or longer sections with \startcolor[blablue] ... \stopcolor.

(See also "Color and Background" in the manual!)

Sample

\setupcolors[state=start]
\definecolor[blablue][r=.25, g=.1, b=1, c=1, m=.1, y=0, k=0, s=.2]

Here's some \color[blablue]{blue text} inbetween!

\showcolor[rgb]

Colorgroups and Palettes

\definecolorgroup[name][system][values]

\definepalet[palettename][colorname1=groupcolor:1, colorname2=groupcolor:2, ...]

Very interesting feature, to be described later... (see manual)