POV-Ray : Newsgroups : povray.general : A color component extraction bug? : Re: A color component extraction bug? Server Time
10 Aug 2024 23:18:36 EDT (-0400)
  Re: A color component extraction bug?  
From: Jerome M  BERGER
Date: 20 Oct 1999 13:13:36
Message: <380DF833.21FC33F8@enst.fr>
Philippe Debar wrote:
> I got a problem with colour component extraction. It seems that when
> you use colour component extraction and use the result immediately,
> what you got is a float. But if there is an intermediate step
> (#declare, #local or pass as a macro argument), it reverts to a colour.
> 
> In other word:
> floatFunction(aColor.red) is OK, but
> #declare myFloat=aColor.red is not a float but a colour
> 
> I suspect this is a bug. But of course I could be wrong (would not be
> the first time). Could you please check? I browsed p.bugreports but
> could find nothing related.
> 
	AFAIK this is due to the fact that pov uses the first thing it
encouters after the "=" sign to determine the type of the variable.

#declare myFloat=aColor.red is a color because aColor is used to
determine the type, but:
#declare myFloat=0+aColor.red is a float as expected...

		Jerome

-- 
*******************************

* they'll tell you what can't * mailto:ber### [at] inamecom
* be done and why...          * http://www.enst.fr/~jberger
* Then do it.                 *
*******************************


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.