From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62938 Path: news.gmane.org!not-for-mail From: Michael Murphy Newsgroups: gmane.comp.tex.context Subject: ConText, TikZ and definecolor: undefined control sequence Date: Tue, 26 Oct 2010 12:20:47 +0200 Message-ID: <1288088447.2222.4.camel@silver-fox> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1288088465 25783 80.91.229.12 (26 Oct 2010 10:21:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 26 Oct 2010 10:21:05 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 26 12:21:03 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PAgeN-0007Cz-4R for gctc-ntg-context-518@m.gmane.org; Tue, 26 Oct 2010 12:21:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 22C2DC9A7C; Tue, 26 Oct 2010 12:21:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bG8EahHryzTg; Tue, 26 Oct 2010 12:20:58 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 57F2DCA77B; Tue, 26 Oct 2010 12:20:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3A384CA77B for ; Tue, 26 Oct 2010 12:20:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id U3p5owzqYVHx for ; Tue, 26 Oct 2010 12:20:54 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id C8725C9A7C for ; Tue, 26 Oct 2010 12:20:54 +0200 (CEST) Original-Received: from mail.uni-ulm.de (mail.uni-ulm.de [134.60.1.11]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9QAKsMI021547 for ; Tue, 26 Oct 2010 12:20:54 +0200 Original-Received: from [192.168.178.46] (p54A97209.dip.t-dialin.net [84.169.114.9]) (authenticated bits=0) by mail.uni-ulm.de (8.14.3/8.14.2) with ESMTP id o9QAKqaq012281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 26 Oct 2010 12:20:52 +0200 (MEST) X-Mailer: Evolution 2.30.3 X-DCC-Misty-Metrics: poseidon 1170; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: by amavisd-new X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=134.60.1.11; country=DE; region=01; city=Albert; latitude=47.5833; longitude=8.1167; http://maps.google.com/maps?q=47.5833,8.1167&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rDnmkSEq - de3a8fe6e25f - 20101026 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:62938 Archived-At: Hi, I've been trying to get colors to work in TikZ, and found a nice fix by Aditya here: http://archive.contextgarden.net/message/20100120.220124.f2d3f8bc.en.html The problem is that the lua script doesn't work: I get a problem with 'colors'. LuaTeX error
:13: attempt to index global 'colors' (a nil value) stack traceback:
:13: in function 'registercolor'
:1: in main chunk. The input file from Aditya (called colorfix.tex) is \startluacode pgfutil = pgfutil or { } local texsprint, format = tex.sprint, string.format local prtcatcodes = tex.prtcatcodes function pgfutil.unsupported_color(name) texsprint(prtcatcodes,format("\\PackageError{pgf}{color %s has unsupported model}{}", name)) texsprint(prtcatcodes,format("\\pgfutil@definecolor{%s}{gray}{0}", name)) end function pgfutil.registercolor(name, attributes) print(name, attributes) local cv = colors.value(attributes) if cv then local model = cv[1] if model == 1 then print("model=1") texsprint(prtcatcodes,format("\\pgfutil@definecolor{%s}{gray}{% 1.3f}", name, cv[2])) elseif model == 3 then print("model=2") texsprint(prtcatcodes,format("\\pgfutil@definecolor{%s}{rgb}{% 1.3f,%1.3f,%1.3f}", name, cv[3], cv[4], cv[5])) else print("no model") pgfutil.unsupported_color(name) end else print("no color") pgfutil.unsupported_color(name) end end \stopluacode \unprotect \def\pgfutil@registercolor#1% {\ctxlua{pgfutil.registercolor("#1",\thecolorattribute {#1})}} \protect and my test file is \usemodule[tikz] \input colorfix \definecolor[mycolor][r=1,g=0,b=1] \starttext \starttikzpicture \fill[mycolor] (0,0) circle (1); \stoptikzpicture \stoptext I'm running the latest beta. ___________________________________________________________________________________ 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 ___________________________________________________________________________________