// Persistence of Vision Ray Tracer Scene Description File // File: Bastard tiling shapes.pov // Vers: 3.7.3 // Desc: Macro for calculate a pigment in the cromatic wheel // Date: August 2011 // Auth: B Gimeno // Web: http://www.persistencia.org /* Takes a pigment as input and returns the pigment placed at A degrees in the cromatic wheel pigment {CW_angle(Red,180} // returns cyan pigment {CW_angle(Red,120} // returns green pigment {CW_angle(Red,240} // returns blue */ #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 (, Max, Span); #local S = 0; #if (Max!=0) #local S = Span/Max; #end #local P = ; #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 #end