Difference between revisions of "Color"

From Wiki
Jump to navigation Jump to search
m
m (added transparency hint)
Line 1: Line 1:
< [[Visuals]] | [[Transparency]] | [[Graphics]] >
+
< [[Visuals]] | [[Graphics]] >
  
 
=Using Colors=
 
=Using Colors=
Line 14: Line 14:
 
* Try the magic <cmd>showcolor</cmd><tt>[xxx]</tt>!
 
* Try the magic <cmd>showcolor</cmd><tt>[xxx]</tt>!
 
* Define your own colors with <cmd>definecolor</cmd><tt>[blablue][r=.1, g=.1, b=1, c=1, m=.1, y=0, k=0, s=.2]</tt> (definition for RGB, CMYK and Grey!)
 
* Define your own colors with <cmd>definecolor</cmd><tt>[blablue][r=.1, g=.1, b=1, c=1, m=.1, y=0, k=0, s=.2]</tt> (definition for RGB, CMYK and Grey!)
 +
* You can define '''transparent''' colors through setting t, e.g. <tt>t=0.5</tt>. Beware, most PDF viewers and printshops can't handle PDF transparences!
 
* Use the color name like <tt>[color=blablue]</tt> in some <tt>\setup...</tt> command.
 
* Use the color name like <tt>[color=blablue]</tt> in some <tt>\setup...</tt> command.
 
* Typeset single text elements with <cmd>color</cmd><tt>[blablue]{nice blue text}</tt> or longer sections with <cmd>startcolor</cmd><tt>[blablue] ...</tt> <cmd>stopcolor</cmd>.
 
* Typeset single text elements with <cmd>color</cmd><tt>[blablue]{nice blue text}</tt> or longer sections with <cmd>startcolor</cmd><tt>[blablue] ...</tt> <cmd>stopcolor</cmd>.

Revision as of 17:31, 25 November 2004

< Visuals | 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!)
  • You can define transparent colors through setting t, e.g. t=0.5. Beware, most PDF viewers and printshops can't handle PDF transparences!
  • 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)