It seems that pgf
does not have any built-in support for cmyk
when using ConTeXt. As a result, the macro \pgfutil@registercolor
, which chooses colour models, is hard-coded not to try anything other than rgb
and gray
. Thus we need alter that macro and provide the necessary internal conversion:
\usemodule[tikz]
\definecolor[c][c=1]
\starttext
\unprotect
\def\pgfutil@registercolor#1{%
\edef\pgf@temp{\PDFcolor{#1}}%
\edef\pgf@marshal{\noexpand\pgfutil@in@{g}{\pgf@temp}}%
\pgf@marshal
\ifpgfutil@in@
\expandafter\pgfutil@context@parse@gray\pgf@temp\pgf@stop{#1}%
\else
\edef\pgf@marshal{\noexpand\pgfutil@in@{rg}{\pgf@temp}}%
\pgf@marshal
\ifpgfutil@in@
\expandafter\pgfutil@context@parse@rgb\pgf@temp\pgf@stop{#1}%
\else
\edef\pgf@marshal{\noexpand\pgfutil@in@{k}{\pgf@temp}}%
\pgf@marshal
\ifpgfutil@in@
\expandafter\pgfutil@context@parse@cmyk\pgf@temp\pgf@stop{#1}%
\else
\PackageError{pgf}{Color #1 has an unsupported color model.}{}%
\pgfutil@definecolor{#1}{gray}{0}%
\fi
\fi
\fi
}
\def\pgfutil@context@parse@cmyk#1 #2 #3 #4k#5\pgf@stop #6{%
\pgfutil@definecolor{#6}{cmyk}{#1,#2,#3,#4}%
}
\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{%
\expandafter\def\csname\string\color@#1\endcsname
{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}%
}
\protect
\tikz\node[c]{t};
\stoptext
Original answer (to a slightly different question!)
Two things are going on here. First, pgf
does not support ConTeXt's \definecolor
: there is a note to the effect in the manual. So you need to use \pgfutil@definecolor
instead. Secondly, there is no built-in code for a cmyk
model when working with ConTeXt. However, this does not seem to be too hard to emulate:
\usemodule[tikz]
\unprotect
\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{%
\expandafter\def\csname\string\color@#1\endcsname
{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}%
}
\pgfutil@definecolor{c}{cmyk}{1,0,0,0}
\protect
\starttext
\tikz\node[c]{t};
\stoptext