From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76192 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: ConTeXt colours in TikZ Date: Tue, 15 May 2012 16:11:10 +0200 Message-ID: <4FB263FE.5050407@wxs.nl> References: <20120515121602.639cc961@Zewz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1337091104 26300 80.91.229.3 (15 May 2012 14:11:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 May 2012 14:11:44 +0000 (UTC) Cc: Marco To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 15 16:11:42 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SUITV-0004av-Q3 for gctc-ntg-context-518@m.gmane.org; Tue, 15 May 2012 16:11:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5EEC3101EB; Tue, 15 May 2012 16:11:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ROfzq9-bvaWv; Tue, 15 May 2012 16:11:37 +0200 (CEST) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 22424101DF; Tue, 15 May 2012 16:11:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3A93E101DF for ; Tue, 15 May 2012 16:11:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZaMiijpL1Ej6 for ; Tue, 15 May 2012 16:11:34 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 45981101CF for ; Tue, 15 May 2012 16:11:34 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q4FEBXbi032285 for ; Tue, 15 May 2012 16:11:33 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 5.3h2) with ESMTP (TLS) id 1324-1713362 for multiple; Tue, 15 May 2012 16:11:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <20120515121602.639cc961@Zewz> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=03; city=Hattem; latitude=52.4724; longitude=6.0696; http://maps.google.com/maps?q=52.4724,6.0696&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0THaebxNW - 040c8942abff - 20120515 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:76192 Archived-At: On 15-5-2012 12:16, Marco wrote: > Hi everybody, > > I don't get context colours working in tikz. There were several > issues on the mailing list in the past and the solution always seems > to be some kind of hack. But none of the hacks work (with a current > context). Example: > > \usemodule [tikz] > \definecolor [darkblue] [b=.2] > \starttext > \starttikzpicture > % works > \fill [blue] (0,0) circle(1); > > % fails > % \fill [darkblue] (0,0) circle(1); > \stoptikzpicture > \stoptext > > I get the following error: > > Runaway argument? > 0 0 0.2 rg 0 0 0.2 RG\pgf@stop {darkblue}\else \edef \pgf@marshal {\noexpand \ETC. > ! File ended while scanning use of \pgfutil@context@parse@gray. > > system> tex> error on line 0 in file : File ended while scanning use of \pgfutil@conte > xt@parse@gray ... > > > > > \par In pgfutil-context.def there is a macro \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 } which tests for gray (g) before rgb (rg) but I think should reverse that order \def\pgfutil@registercolor#1{% \edef\pgf@temp{\PDFcolor{#1}}% \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@{g}{\pgf@temp}}% \pgf@marshal \ifpgfutil@in@ \expandafter\pgfutil@context@parse@gray\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 } feel free to test this and submit it as patch to the tikz maintainers. For mkiv the whole checker/converter can be replaced by a few lines of code but I won't bother you with that. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________