Difference between revisions of "Color"

From Wiki
Jump to navigation Jump to search
(Added overprint=yes tip from Hans)
Line 50: Line 50:
 
To produce a file ready for a clean PDF separation process at your print house, start with:
 
To produce a file ready for a clean PDF separation process at your print house, start with:
  
<cmd>setupcolors</cmd><tt>[rgb=no,cmyk=no,spot=yes,state=start]</tt>
+
<cmd>setupcolors</cmd><tt>[rgb=no,cmyk=yes,spot=yes,state=start,overprint=yes]</tt>
  
which will set things up for spot colors only, no RGB or CMYK allowed. Then define your basic spot colour. Note that this cannot contain spaces or numbers:
+
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):
  
 
<cmd>definecolor</cmd><tt>[PantoneTwoNineFour][c=1,m=.56,y=0,k=.18]</tt>
 
<cmd>definecolor</cmd><tt>[PantoneTwoNineFour][c=1,m=.56,y=0,k=.18]</tt>

Revision as of 17:18, 17 March 2005

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

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)

Spot colours

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

\setupcolors[rgb=no,cmyk=yes,spot=yes,state=start,overprint=yes]

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):

\definecolor[PantoneTwoNineFour][c=1,m=.56,y=0,k=.18]

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:

\definecolor[MyBlue][PantoneTwoNineFour][p=1]

And then a 20% tint for nice display boxes:

\definecolor[MyBlueTint][PantoneTwoNineFour][p=.2]

And now you can happily use these named colours:

\starttext
   \color[MyBlue]{Interesting}
\stoptext

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!

Multitones

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:

\setupcolors[state=start]

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

\starttext

\startcolor[blue]\blackrule[width=3cm,height=3cm]\stopcolor

\startcolor[yellow]\blackrule[width=3cm,height=3cm]\stopcolor

\startcolor[combicolor]\blackrule[width=3cm,height=3cm]\stopcolor

\stoptext

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