[Date Index] [Thread Index] [Author Index]
Determine brightness of colour/Convert to GrayLevel
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? I would like to determine the "brightness" of a colour to decide whether to display text in black or in white on top of it. Also, is there a way to convert a colour to some canonical representation? A workaround I found is Lighter[colour, 0], which converts to RGBColor, but I was hoping that there exists a function meant specifically for conversion (and not blending/lightening/darkening).