Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!shelby!portia!Jessica!rick From: rick@Jessica.stanford.edu (Rick Wong) Newsgroups: comp.sys.mac.programmer Subject: Re: Changing the darkness of a Color Message-ID: <4001@portia.Stanford.EDU> Date: 27 Jul 89 18:31:59 GMT References: <6073@hubcap.clemson.edu> Sender: USENET News System Reply-To: rick@Jessica.UUCP (Rick Wong) Organization: Stanford University Lines: 21 In article <6073@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes: >If i have a color chosen from the Color Picker, i.e. an RGBColor record, >how can i get colors ranging from white to that color. For instance, if the >user picks a dark blue i want to go from white to dark blue, but ALWAYS be >a blue, no reds or yellows. > >Michael O'Rourke I'm not too familiar with color models, but a little playing with the Color Picker shows that you want to be working with HSV (hue, saturation, value/brightness) colors. The hue determines whether it's reddish, bluish, or whatever. White corresponds to minimal saturation (0) and maximum brightness (65535). Therefore, to go from white to some target color {H,S,V} would require starting at {H,0,65535} and varying the saturation and value so that they eventually reach the target saturation and value. Fortunately, the Color Picker Package provides conversion routines (HSV2RGB and RGB2HSV) that translate between RGB and HSV colors. Rick Wong rick@jessica.stanford.edu