Ball Halal 1
Ball Halal 1
return val;
}
hsv[2] = _max;
delta = _max - _min;
if(_max != 0.0)
{
hsv[1] = delta / _max;
}
else
{
return hsv;
}
if(color.r == _max)
{
hsv[0] = (color.g - color.b ) / delta; // between yellow &
magenta
}
if(hsv[1] == 0.0)
{
// achromatic (grey)
color.r = hsv[2];
color.g = hsv[2];
color.b = hsv[2];
return color;
}
if (i == 0)
{
color.r = hsv[2];
color.g = t;
color.b = p;
}
else if (i == 1)
{
color.r = q;
color.g = hsv[2];
color.b = p;
}
else if (i == 2)
{
color.r = p;
color.g = hsv[2];
color.b = t;
}
else if (i == 3)
{
color.r = p;
color.g = q;
color.b = hsv[2];
}
else if (i == 4)
{
color.r = t;
color.g = p;
color.b = hsv[2];
}
else // case 5:
{
color.r = hsv[2];
color.g = p;
color.b = q;
}
return color;
}
// https://beesbuzz.biz/code/hsv_color_transforms.php
vec3 TransformHSV(
vec3 c, // color to transform
float H, // hue shift (in degrees)
float S, // saturation multiplier (scalar)
float V) // value multiplier (scalar)
{
float M_PI = 3.1415926;
vec3 ret;
void main()
{
vec2 uv = fragCoord.xy / iResolution.xy;
vec4 color = texture2D(bitmap,uv);
vec3 c = color.rgb;