Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ll-xn!oberon!pollux.usc.edu!papa From: papa@pollux.usc.edu (Marco Papa) Newsgroups: comp.sys.amiga Subject: Re: RGB to HSV Colors Message-ID: <9410@oberon.USC.EDU> Date: 28 May 88 03:25:38 GMT References: <8805271453.AA13503@jade.berkeley.edu> Sender: news@oberon.USC.EDU Reply-To: papa@pollux.usc.edu (Marco Papa) Organization: Felsina Software, Los Angeles, CA Lines: 21 In article <8805271453.AA13503@jade.berkeley.edu> BBOURBIN@UMDD.BITNET (Brett S Bourbin) writes: |Does anyone out there know of a formula for converting a RGB (red green blue) |color value, into a HSV (hue saturation value) one? | |I think it is some sort or ratio but I would like to know the "correct" |method. (Dan Silva, are you out there? 8^) ) Get hold of a copy of "Procedural Elements for Computer Graphics", by David F. Rogers, McGraw-Hill Book Co., 1985. On page 401 through 406 you will find pseudo-pascal code for HSV->RGB, RGB->HSV, HLS->RGB, and RGB->HLS conversions. It took me about an hour to transform them in C, and all the algorithms DO work. This book is in my opinion one of the BEST computer graphics books. This is David's second book (the first one was Mathematical Elements for Computer Graphics). I hear that a third book is or will soon be published. -- Marco Papa 'Doc' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= uucp:...!pollux!papa BIX:papa ARPAnet:pollux!papa@oberon.usc.edu "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=