POV-Ray : Newsgroups : povray.general : HLS in color_maps? : Re: HLS in color_maps? Server Time
16 May 2024 14:01:39 EDT (-0400)
  Re: HLS in color_maps?  
From: Alain
Date: 22 Jan 2016 20:28:07
Message: <56a2d727@news.povray.org>
Le 16-01-22 19:17, Mike Horvath a écrit :
> On 1/22/2016 7:05 PM, clipka wrote:
>> Am 23.01.2016 um 00:53 schrieb Mike Horvath:
>>> I know there is a macro to convert HLS colors into RGB colors. But can
>>> this be done in color_maps?
>>
>> Sure, why not.
>>
>> Note however that this will /not/ give you colour interpolation in HLS
>> space.
>>
>
> I meant being able to go from hls <0,1/2,1> to hls <1,1/2,1> inside the
> color_map with smooth gradations.
>
> Mike

Copy the macro in your scene.
Build your colour_map with a loop that goes through the hue values in 
relatively small steps, say 0.01 to 0.03.
Use the macro to convert each values to the appropriate RGB values.

That way, the disparity between the two colour spaces are kept small 
enough so that they are not perceptible.

The initial copy of the macro is done to speed up the parsing. 
Otherwise, you need to read the whole source file each times the macro 
is used.


Post a reply to this message

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