ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MPcolor problem (CMYK)
@ 2005-08-10 14:13 Jin-Hwan Cho
  2005-08-10 16:18 ` Vit Zyka
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jin-Hwan Cho @ 2005-08-10 14:13 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

In the MetaFun manual (metafun-p.pdf) p.117, you may see an example
using the color ".5\MPcolor{cmyyellow}". But I could not generate
the color. Could anyone check the attached sample?

Best, ChoF.
~~~~~~~~~~~~~~~~~~~~~~~~~   ***
| Cho, Jin-Hwan == ChoF |   ^ ^
~~~~~~~~~~~~~~~~~~~~~~~~~~~  o
| Dept. of Mathematics    | ---
| The University of Suwon |  |
~~~~~~~~~~~~~~~~~~~~~~~~~~~  |
| Korean TeX Users Group  |  |
| http://www.ktug.or.kr   |  |
~~~~~~~~~~~~~~~~~~~~~~~~~~~  |
| chofchof@ktug.or.kr |     ***
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


[-- Attachment #2: ch35.tex --]
[-- Type: application/octet-stream, Size: 1047 bytes --]

% Chapter 3. Embedded graphics
%
% 3.5 Communicating color
\setupcolors [state=start]
\setupinteraction [state=start]

\starttext

  \definecolor[cmyyellow][y=1]
  \definecolor[rgbyellow][r=1,g=1]

  \definecolor[cmydarkyellow][y=.625] 
  \definecolor[rgbdarkyellow][r=.625,g=.625]

  \startuseMPgraphic{All kinds of yellow}
    pickup pencircle scaled 1mm ;
    path p ; p := unitsquare xscaled 3cm yscaled 1cm ;
    fill p shifted (0cm,0cm) withcolor yellow ;
    fill p shifted (4cm,0cm) withcolor (1,1,0) ;
    fill p shifted (8cm,0cm) withcolor (.5,.5,0) ;
    fill p shifted (0cm,-1.5cm) withcolor \MPcolor{rgbyellow} ;
    fill p shifted (4cm,-1.5cm) withcolor \MPcolor{rgbdarkyellow} ;
    fill p shifted (8cm,-1.5cm) withcolor .5\MPcolor{rgbyellow} ;
    fill p shifted (0cm,-3cm) withcolor \MPcolor{cmyyellow} ;
    fill p shifted (4cm,-3cm) withcolor \MPcolor{cmydarkyellow} ;
    fill p shifted (8cm,-3cm) withcolor .5\MPcolor{cmyyellow} ; % do not work correctly!
  \stopuseMPgraphic

  \useMPgraphic{All kinds of yellow}

\stoptext


[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: MPcolor problem (CMYK)
  2005-08-10 14:13 MPcolor problem (CMYK) Jin-Hwan Cho
@ 2005-08-10 16:18 ` Vit Zyka
  2005-08-10 16:27   ` Taco Hoekwater
  2005-08-10 16:49 ` Mojca Miklavec
  2005-08-10 20:39 ` Hans Hagen
  2 siblings, 1 reply; 10+ messages in thread
From: Vit Zyka @ 2005-08-10 16:18 UTC (permalink / raw)


Jin-Hwan Cho wrote:
> In the MetaFun manual (metafun-p.pdf) p.117, you may see an example
> using the color ".5\MPcolor{cmyyellow}". But I could not generate
> the color. Could anyone check the attached sample?

Let check
- \setupcolors[state=start]
- perhaps typo 'cmyyellow -> cmykyellow' or define it by yourself:
   \definecolor[cmyyellow][c=0,m=0,y=1,k=0]

Cheers
vit

> Best, ChoF.

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

* Re: MPcolor problem (CMYK)
  2005-08-10 16:18 ` Vit Zyka
@ 2005-08-10 16:27   ` Taco Hoekwater
  2005-08-10 20:29     ` Mojca Miklavec
  2005-08-10 20:42     ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Taco Hoekwater @ 2005-08-10 16:27 UTC (permalink / raw)


Vit Zyka wrote:
> Jin-Hwan Cho wrote:
> 
>> In the MetaFun manual (metafun-p.pdf) p.117, you may see an example
>> using the color ".5\MPcolor{cmyyellow}". But I could not generate
>> the color. Could anyone check the attached sample?
> 
> 
> Let check
> - \setupcolors[state=start]
> - perhaps typo 'cmyyellow -> cmykyellow' or define it by yourself:
>   \definecolor[cmyyellow][c=0,m=0,y=1,k=0]

Both were present in the example. I've created a collector item
for this. (which means that I believe it really is a bug :-))

   http://context.literatesolutions.com/collector/22/pcng_issue_view

Cheers
Taco

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

* Re: MPcolor problem (CMYK)
  2005-08-10 14:13 MPcolor problem (CMYK) Jin-Hwan Cho
  2005-08-10 16:18 ` Vit Zyka
@ 2005-08-10 16:49 ` Mojca Miklavec
  2005-08-10 20:17   ` Hans Hagen
  2005-08-10 20:39 ` Hans Hagen
  2 siblings, 1 reply; 10+ messages in thread
From: Mojca Miklavec @ 2005-08-10 16:49 UTC (permalink / raw)


Jin-Hwan Cho wrote:
> In the MetaFun manual (metafun-p.pdf) p.117, you may see an example
> using the color ".5\MPcolor{cmyyellow}". But I could not generate
> the color. Could anyone check the attached sample?

You get pretty different results depending on what you write to
\setupcolors[conversion=yes/no/always,reduction=yes/no,rgb=yes/no,cmyk=yes/no,mpcmyk=yes/no]
but I don't know what exactly they mean. The example in the manual
with \MPcolor{cmyyellow} doesn't seem to be proper "cmyk kind of
yellow" (c=0.08,m=0,y=0.89,k=0), so Hans probably used a set of setups
which handles the .5\MPcolor{cmyyellow} the same way as if it was an
"rgb yellow".

Does \setupcolors[cmyk=no] suit your needs? However, you have to be
aware that your "cmyyellow" won't be y=1 any more, but the yellow
mentioned above.

Your example results in a color that is (c=.68,m=.71,y=.64,k=.86), so
it is still "a kind of OK mixing", but the computer doesn't know in
which way you would like the colors to be mixed.


An alternative (for brighter colors in this case) is to write

.5[\MPcolor{cmyyellow},\MPcolor{cmywhite}]

if you define cmykwhite to be something like
\definecolor[cmywhite][y=0.00001]


What I don't understand is why
\definecolor[cmywhite][c=0,y=0,m=0,k=0]
is converted to black (even a warning is issued).

Mojca

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

* Re: MPcolor problem (CMYK)
  2005-08-10 16:49 ` Mojca Miklavec
@ 2005-08-10 20:17   ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2005-08-10 20:17 UTC (permalink / raw)


Mojca Miklavec wrote:

>yellow" (c=0.08,m=0,y=0.89,k=0), so Hans probably used a set of setups
>which handles the .5\MPcolor{cmyyellow} the same way as if it was an
>"rgb yellow".
>  
>
indeed, i use slightly different red/yellow in the metafun manual -)

but i'm not sure if that is the problem here

Hans

 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: MPcolor problem (CMYK)
  2005-08-10 16:27   ` Taco Hoekwater
@ 2005-08-10 20:29     ` Mojca Miklavec
  2005-08-10 20:44       ` Hans Hagen
  2005-08-10 20:42     ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Mojca Miklavec @ 2005-08-10 20:29 UTC (permalink / raw)


Taco Hoekwater wrote:
> > Jin-Hwan Cho wrote:
> >
> >> In the MetaFun manual (metafun-p.pdf) p.117, you may see an example
> >> using the color ".5\MPcolor{cmyyellow}". But I could not generate
> >> the color. Could anyone check the attached sample?
> 
> Both were present in the example. I've created a collector item
> for this. (which means that I believe it really is a bug :-))

I tried

\definecolor[cmyyellow][y=1]
\definecolor[cmycyan][c=1]

and then .5[\MPcolor{cmycyan},\MPcolor{cmyyellow}]

Without the cmyk=no option, color mixing really works wrong (I get
yellow instead of green, perhaps c=.5,y=.5 would be something to
expect), but with it, my Acrobat states that the colors are not proper
cyan and yellow any more (but the exact numbers probably depend on
settings for cmky->rgb->cmyk conversion).

Well, the best conversion ever seen was the one by MS Word (when I
tried to include a cmyk pdf image into a document): blue became green,
red resulted in blue and yellow in pink ;)

About the problem of "white cmyk color"
(\definecolor[colorname][c=0,m=0,y=0,k=0]): I guess that the problem
could lie in the \doifelse loop(s) of \dododefinecolor in
colo-ini.tex. The loop simply checks if any color component is
different from zero and chooses the first suitable color space. CMYK
white is probably the only exception to this rule.
What about deciding about the color system on the basis of settings
used (r=0 => rgb or c=0 => cmy(k) or ...), before executing this
(modified) loop? Or perhaps having some predefined "zero" colors
(cmykwhite for example)? An usual rgb white can be used, but I'm not
sure if it can be properly mixed with cmyk colors then.

Mojca

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

* Re: MPcolor problem (CMYK)
  2005-08-10 14:13 MPcolor problem (CMYK) Jin-Hwan Cho
  2005-08-10 16:18 ` Vit Zyka
  2005-08-10 16:49 ` Mojca Miklavec
@ 2005-08-10 20:39 ` Hans Hagen
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2005-08-10 20:39 UTC (permalink / raw)


Jin-Hwan Cho wrote:

> In the MetaFun manual (metafun-p.pdf) p.117, you may see an example
> using the color ".5\MPcolor{cmyyellow}". But I could not generate
> the color. Could anyone check the attached sample?

scaling of cmykcolors does not work when cmykcolors i sset to true; this is because i used colors as signals for the postprocessor and in this case the postprocessor code gets scaled and is no longer recognizable as  such and therefore it's treates as a normal color

tricky stuff 

a solution is to define the 50% color beforehand 

Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: MPcolor problem (CMYK)
  2005-08-10 16:27   ` Taco Hoekwater
  2005-08-10 20:29     ` Mojca Miklavec
@ 2005-08-10 20:42     ` Hans Hagen
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2005-08-10 20:42 UTC (permalink / raw)


Taco Hoekwater wrote:

> Vit Zyka wrote:
>
>> Jin-Hwan Cho wrote:
>>
>>> In the MetaFun manual (metafun-p.pdf) p.117, you may see an example
>>> using the color ".5\MPcolor{cmyyellow}". But I could not generate
>>> the color. Could anyone check the attached sample?
>>
>>
>>
>> Let check
>> - \setupcolors[state=start]
>> - perhaps typo 'cmyyellow -> cmykyellow' or define it by yourself:
>>   \definecolor[cmyyellow][c=0,m=0,y=1,k=0]
>
>
> Both were present in the example. I've created a collector item
> for this. (which means that I believe it really is a bug :-))
>
>   http://context.literatesolutions.com/collector/22/pcng_issue_view

i'll add an note that taco will implement specials associated with paths in teh coming metapost release -) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: MPcolor problem (CMYK)
  2005-08-10 20:29     ` Mojca Miklavec
@ 2005-08-10 20:44       ` Hans Hagen
  2005-08-11  8:37         ` Mojca Miklavec
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2005-08-10 20:44 UTC (permalink / raw)


Mojca Miklavec wrote:

>
>\definecolor[cmyyellow][y=1]
>\definecolor[cmycyan][c=1]
>
>and then .5[\MPcolor{cmycyan},\MPcolor{cmyyellow}]
>  
>
look in mp-spec how cmyk is defined and you'll see why it gets messed up ... cmyk expands to a special directive and .5 scales that one, if needed i can make a scale macro 

Hans 
 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: MPcolor problem (CMYK)
  2005-08-10 20:44       ` Hans Hagen
@ 2005-08-11  8:37         ` Mojca Miklavec
  0 siblings, 0 replies; 10+ messages in thread
From: Mojca Miklavec @ 2005-08-11  8:37 UTC (permalink / raw)


Hans Hagen wrote:
> Mojca Miklavec wrote:
> 
> >
> >\definecolor[cmyyellow][y=1]
> >\definecolor[cmycyan][c=1]
> >
> >and then .5[\MPcolor{cmycyan},\MPcolor{cmyyellow}]
> >
> look in mp-spec how cmyk is defined and you'll see why it gets messed up ... cmyk expands to a special directive and .5 scales that one, if needed i can make a scale macro

I'm sorry. I could have thought about that before :(.

Mojca

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

end of thread, other threads:[~2005-08-11  8:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-10 14:13 MPcolor problem (CMYK) Jin-Hwan Cho
2005-08-10 16:18 ` Vit Zyka
2005-08-10 16:27   ` Taco Hoekwater
2005-08-10 20:29     ` Mojca Miklavec
2005-08-10 20:44       ` Hans Hagen
2005-08-11  8:37         ` Mojca Miklavec
2005-08-10 20:42     ` Hans Hagen
2005-08-10 16:49 ` Mojca Miklavec
2005-08-10 20:17   ` Hans Hagen
2005-08-10 20:39 ` 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).