From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/69546 Path: news.gmane.org!not-for-mail From: Hans van der Meer Newsgroups: gmane.comp.tex.context Subject: cmyk in metapost Date: Sun, 26 Jun 2011 13:51:23 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1309089187 23546 80.91.229.12 (26 Jun 2011 11:53:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Jun 2011 11:53:07 +0000 (UTC) To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Sun Jun 26 13:53:03 2011 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 1Qante-0003um-FI for gctc-ntg-context-518@m.gmane.org; Sun, 26 Jun 2011 13:53:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C04F3CADBC; Sun, 26 Jun 2011 13:53:01 +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 xl72Ezzk-FDG; Sun, 26 Jun 2011 13:52:58 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 12F2DCAD0E; Sun, 26 Jun 2011 13:52:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AA64ECAB80 for ; Sun, 26 Jun 2011 13:52:56 +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 I7N5vAm4GX1A for ; Sun, 26 Jun 2011 13:52: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 E43F6CAD30 for ; Sun, 26 Jun 2011 13:52:54 +0200 (CEST) Original-Received: from smtp-vbr4.xs4all.nl (smtp-vbr4.xs4all.nl [194.109.24.24]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p5QBqsEj028990 for ; Sun, 26 Jun 2011 13:52:54 +0200 Original-Received: from elhalyn-ethernet.fritz.box (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by smtp-vbr4.xs4all.nl (8.13.8/8.13.8) with ESMTP id p5QBpO7V077951 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Sun, 26 Jun 2011 13:51:24 +0200 (CEST) (envelope-from H.vanderMeer@uva.nl) X-Mailer: Apple Mail (2.1084) X-Virus-Scanned: by XS4ALL Virus Scanner X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=194.109.24.24; country=NL; latitude=52.5000; longitude=5.7500; http://maps.google.com/maps?q=52.5000,5.7500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rF0zQSE7 - e809e550c662 - 20110626 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:69546 Archived-At: I must be doing something wrong. But what? Relevant part of Metapost code: numeric Cb, Cr, Y, T, temp, graycolors; Cb := 0; Cr := 1; Y = 2; T := 3; graycolors := 15; numeric colors[][];for i = 0 upto graycolors: temp := (graycolors - i) / graycolors; colors[i][Cb] := temp; colors[i][Cr] := temp; colors[i][Y] := temp; colors[i][T] := 0; endfor def colorvalue(expr v) = cmyk(colors[v][Cb], colors[v][Cr], colors[v][Y], colors[v][T]) enddef; for i = 0 upto 15: mycmyk[i] := colorvalue(i); endfor Used with drawdot... withcolor mycymk[index]; The error from metapost is in the generation of the cmyk colors: ! terminal: >> (redpart mycmyk0,greenpart mycmyk0,bluepart mycmyk0) >> (1,1,1,0) ! Equation cannot be performed (color=cmykcolor). ; mycmyk[(EXPR0)]:=colorvalue((EXPR0)); ENDFOR startsubtitle->...:mycmyk[i]:=colorvalue(i);endfor Strangely the following does work without problems: drawdot... withcolor colorvalue(index); I got the code from the Metafun manual. Beta from ConTeXt ver: 2011.03.28 01:03 MKIV download. Something obvious I am overlooking? Hans van der Meer ___________________________________________________________________________________ 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 ___________________________________________________________________________________