HueGradient 動くよ

クリックで向きが反転

pbkのソース
<languageVersion : 1.0;>

kernel HueGradient
<   namespace : "zahir1929";
vendor : "zahir";
version : 1;
description :"";
>
{
output pixel3 dst;

parameter float rotate<
maxValue: 360.0;
minValue: -360.0;
defaultValue: 0.0;
>;
parameter float2 center<
maxValue: float2(4000);
minValue: float2(0);
defaultValue: float2(128);
>;
parameter int Reflection<
maxValue: 1;
minValue: 0;
defaultValue: 1;
>; 
void
evaluatePixel(){
float2 d = center - outCoord();
float t = mod(atan(d.x, d.y) / 0.01745 + rotate, 360.0);
if(Reflection == 1) t *= -1.0;
if(t < 0.0) t += 360.0;
t /= 60.0;
float h = floor(t);
float v = ceil( 255.0 * (1.0 - ( 1.0 - t + h))) / 255.0;
float v2 = ceil( 255.0 * (1.0 - t + h)) / 255.0;
if( h  == 0.0 ){
dst = pixel3(1.0, v, 0.0);
}else if( h == 1.0){
dst = pixel3(v2, 1.0, 0.0);
}else if( h == 2.0){
dst = pixel3(0.0, 1.0, v);
}else if( h == 3.0){
dst = pixel3(0.0, v2, 1.0);
}else if( h == 4.0){
dst = pixel3(v, 0.0, 1.0);
}else if( h == 5.0){
dst = pixel3(1.0, 