POV-Ray : Newsgroups : povray.general : color conversion : Re: color conversion Server Time
29 Jun 2025 14:21:58 EDT (-0400)
  Re: color conversion  
From: MichaelJF
Date: 26 Jun 2025 14:23:01
Message: <685d9005$1@news.povray.org>
Am 26.06.2025 um 18:53 schrieb kurtz le pirate:
> 
> Hello everybody,

colors.inc:

// Converts a color in HSV color space to a color in RGB color space.
// Input:  < Hue, Saturation, Value, Filter, Transmit >
// Output: < Red, Green, Blue, Filter, Transmit >
#macro CHSV2RGB(Color)
    #local HSVFT = color Color;
    #local H = (HSVFT.red);
    #local S = (HSVFT.green);
    #local V = (HSVFT.blue);
    #local SatRGB = CH2RGB(H);
    #local RGB = ( ((1-S)*<1,1,1> + S*SatRGB) * V );
    <RGB.red,RGB.green,RGB.blue,(HSVFT.filter),(HSVFT.transmit)>
#end


Best regards
Michael


Post a reply to this message

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