MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: RGB to CMYK


Hello

Just use the "secret" function ToColor:

In[1]:=
?ToColor

"ToColor[color, form] converts color to form if form is GrayLevel, RGBColor
\
or CMYKColor color is converted into it. Otherwise form[color] is evaluated
\
and the result is expected to be a valid color directive."

In[2]:=
ToColor[RGBColor[1, 0, 0], CMYKColor]

Out[2]=
\!\(CMYKColor[5.46908`*^-6, 0.9958244690799987`, 0.9958244690799987`,
    5.46908`*^-6]\)

Hans


"Bernd Brandt" <bernd at bio.vu.nl> wrote in message
news:8rjik5$odn at smc.vnet.net...
> Hi Group,
>
> I am looking for a conversion function between RGB and CMYK.
> I thought this would not be a problem but i have not found one good
function.
>
> The Mathematica book (examples) includes:
>
> CMYKfromRGB[RGBColor[r_, g_, b_]] :=
> CMYKColor[b, r  b, 1 - b, (r + g + b)/3]
>
> But this is not correct.
> RGBColor[1,0,0] really red, is converted to CMYKColor[0, 0, 1, 0.5],
> which is clearly not red.
>
> Does someone have a correct function?
>
>
> Regards,
> Bernd
>
>
>



  • Prev by Date: Re: ButtonBox and ButtonFuction
  • Next by Date: Complex Function Plot
  • Previous by thread: RGB to CMYK
  • Next by thread: Re: RGB to CMYK