|
|
/*
Takes a pigment as input and returns the pigment placed at A degrees in the
cromatic wheel
pigment {CW_angle(Red,180}
*/
#macro CW_angle (COLOR,A)
#local RGBFT = color COLOR;
#local R = (RGBFT.red);
#local G = (RGBFT.green);
#local B = (RGBFT.blue);
#local Min = min(R,min(G,B));
#local Max = max(R,max(G,B));
#local Span = Max-Min;
#local H = CRGB2H (<R,G,B>, Max, Span);
#local S = 0; #if (Max!=0) #local S = Span/Max; #end
#local P = <H+A,S,Max,(RGBFT.filter),(RGBFT.transmit)> ;
#local HSVFT = color P ;
#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 <RGB.red,RGB.green,RGB.blue,(HSVFT.filter),(HSVFT.transmit)>
#end
Post a reply to this message
|
|