From Wiki
Revision as of 17:18, 17 March 2005 by Duncan (talk | contribs) (Added overprint=yes tip from Hans)
Jump to navigation Jump to search

< Visuals | Graphics >

Using Colors

Using colors with ConTeXt is easy:

  • Start with \setupcolors[state=start]. Without that, everything appears in greys.
  • RGB and CMYK are enabled by default. If you want only RGB or only CMYK color, use cmyk=no or rgb=no. Multitone colors see below.
  • For spot colors, say spot=yes. To eliminate everything except spot colours, leaving a clean file for professional printing, accompany this with rgb=no,cmyk=no. See spot colours below for more details.
  • 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!)


\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!


Colorgroups and Palettes


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

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

Spot colours

To produce a file ready for a clean PDF separation process at your print house, start with:


which will set things up for spot colors with CMYK allowed. The last setting ensures that black overprinting your spot colour tints will not knock out the colour - this is important for some types of commercial printing.

Then define your basic spot colour. Note that the name cannot contain spaces or numbers (but we come to that later):


Now you can define the tints of this ink that you are actually going to use in your document. Let's say you'll have a 100% for headings:


And then a 20% tint for nice display boxes:


And now you can happily use these named colours:


If you are including graphics made by an external program, you might want to match the colour name used in the graphic with the colour name in your ConTeXt set-up so that only one colour space is used in the final file. Unfortunately Pantone names and others tend to have spaces and numbers in them, so you need to do a low-level mapping trick from your base name to the name you want embedded in the file:

\doregisterspotcolorname{PantoneTwoNineFour}{PANTONE 294 CV}

Now your output file should work beautifully with graphics embedded!


Hans wrote on the mailinglist on 2004-12-27 about handling of multitone colors:

Currently it's done by pdftools.rb

Once pdfxTeX becomes pdfeTeX out of a sudden your beta can do it as well.

I still need to figure out a way to automatically reverse the graphic, but one of these days you can start using it.

Actually, multitones for text already work out of the box:


\definecolor [blue]   [c=1,m=.38,y=0,k=.64]
\definecolor [yellow] [c=0,m=.28,y=1,k=.06]

\definecolor [blue-100]   [blue]   [p=1]
\definecolor [yellow-100] [yellow] [p=1]

\definemultitonecolor [combicolor]   [blue=.12,yellow=.28] [c=.1,m=.1,y=.3,k=.1]






(The CMYK color spec is the fall back color used on screen; one can preview separations in full Acrobat 7.)