Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!psuvax1!rutgers!mcnc!thorin!sargent!ellswort From: ellswort@sargent.cs.unc.edu (David Ellsworth) Newsgroups: comp.graphics Subject: Re: bug in hls_to_rgb from Foley, van Dam, Feiner, Hughes Message-ID: <16453@thorin.cs.unc.edu> Date: 2 Oct 90 00:49:52 GMT References: <9009301931.AA14664@nth.com> Sender: news@thorin.cs.unc.edu Reply-To: ellswort@sargent.cs.unc.edu (David Ellsworth) Organization: University Of North Carolina, Chapel Hill Lines: 30 In article <9009301931.AA14664@nth.com> andy@nthropy.UUCP (Andy Lowe) writes: > >I had occasion to implement an hls to rgb converter for a research >project, and turned to the new Foley, vanDam, Feiner, Hughes book for >the algorithm. > >On p. 596 is a procedure that purports to do the conversion. While >studying it, I couldn't see how it worked. (various problems omitted) > >Can someone tell me I'm wrong? (please.) > > (pseudocode on how the algorithm is wrong deleted) Sorry, you are right. The bug list for the book lists these problems with the figure you are referencing: 596, Fig. 13.37, line 4: "n1, n2, hue" -> "n1, n2, hue: real" 596, Fig. 13.37, line 8: "if" -> "else if" 596, Fig. 13.37, line 10: ">" -> "<" 596, Fig. 13.37, line 15: "n2 - 1" -> "n2 - n1" 596, Fig. 13.37, line 22: "l + s - l * s" -> "l + s + l * s" 596, Fig. 13.37, line 23: move line left, flush with "else" two lines above I got the bug list by sending a message to graphtext@cs.brown.edu with a subject of "Get-Text-Bug-List" (as described in a posting about 80 articles back by ethan@thinc.UUCP (Ethan Lish)). --------------- David Ellsworth ellswort@cs.unc.edu