[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

colors



   From: STEVE.M@AppleLink.Apple.COM (Carbon-based, S Mitchell,APD)

Thanks, Steve, for showing how to use the QuickDraw color picker stuff.
I've never actually played with this myself.


   >  From: straz@cambridge.apple.com
   >
   >  A simplified rule of thumb: to get the luminosity (greyscale brightness)
   >  of a color, take  (.2R + .7G + .1B). The eye is much more sensitive
   >  to brightness changes in green than in red or blue, so that's what a
   >  black and white TV does when it displays a color video signal.
   >  [...]
 
   The Mac RGB Color Model's number ranges already adjust for the relative
   brightness of the primary colors - greys are represented by R = G = B,
   and the ranges are linearized, so that (0.5, 0.5, 0.5) is 50% grey.

Actually, this is true on practically any computer - this RGB model
is what most computers use. What I was referring to is how to take a given
color expressed in RGB coordinates and determine its luminosity (brightness),
which is a single number. 

Fortunately, as Steve points out, Quickdraw provides handy conversion
routines for various color models so you can skip the code in my message.
It's just too bad Quickdraw uses faster (but messier) 16-bit integers 
instead of floats between 0 and 1.