10 float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
11 float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g));
12 float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r));
14 float d = q.x - min(q.w, q.y);
16 return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
24 float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
25 float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
26 return float3(c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y));
35 float3
oppositeColor = float3(fmod(((color1hsv.x * 360) + 180), 360) / 360, color2hsv.yz);
46 if (abs(color1hsv.x - color2hsv.x) < 0.05)
56 return color1 + color2;
59 float3 result = color1 + color2Prime;
66 result = color1Prime + color2;
float3 HSVtoRGB(float3 c)
float3 huePreservingColorAdd(float3 color1, float3 color2)
Hue preserving blending function from paper.
float3 RGBtoHSV(float3 c)
bool equalHue(float3 color1, float3 color2)
Checking if the difference between two hues is less than threshold 0.05.
float3 oppositeColor(float3 color1, float3 color2)