ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* cmyk in metapost
@ 2011-06-26 11:51 Hans van der Meer
  2011-06-26 12:12 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Hans van der Meer @ 2011-06-26 11:51 UTC (permalink / raw)
  To: NTG ConTeXt

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).
<to be read again> 
                   ;
<for(0)> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cmyk in metapost
  2011-06-26 11:51 cmyk in metapost Hans van der Meer
@ 2011-06-26 12:12 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2011-06-26 12:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 26-6-2011 1:51, Hans van der Meer wrote:
> I must be doing something wrong. But what?
>
> Relevant part of Metapost code:
>
> I got the code from the Metafun manual. Beta from ConTeXt  ver: 2011.03.28 01:03 MKIV download.
> Something obvious I am overlooking?

cmykcolor is another datatype in mp than color


-----------------------------------------------------------------
                                           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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-26 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-26 11:51 cmyk in metapost Hans van der Meer
2011-06-26 12:12 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).