Re: Determine brightness of colour/Convert to GrayLevel
- To: mathgroup at smc.vnet.net
- Subject: [mg89505] Re: Determine brightness of colour/Convert to GrayLevel
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Wed, 11 Jun 2008 03:18:18 -0400 (EDT)
On 6/10/08 at 7:14 AM, szhorvat at gmail.com (Szabolcs Horv=C3=A1t) wrote: >Colours have several representations, such as RGBColor, CMYKColor, >GrayLevel, etc. >Is there a way to convert between these representations? More >specifically is there a way to convert a colour to GrayLevel? The function you want is ToColor. For example, In[2]:= ToColor[ColorData[1][1], GrayLevel] Out[2]= GrayLevel[0.283193] >Also, is there a way to convert a colour to some canonical >representation? Doesn't RGBColor satisfy your need for a canonical representation? That is it seems to me a canonical representation of a color would simply be a specification of all colors in a single color space which is certainly satisfied by using RGBColor.