mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Fix rgb2hsv
This commit is contained in:
parent
376cd752d6
commit
a8528a9e1d
@ -155,7 +155,7 @@ float3 rgb2hsv(float3 rgb) {
|
|||||||
float bc = (M - rgb.z) * C;
|
float bc = (M - rgb.z) * C;
|
||||||
|
|
||||||
if (rgb.x == M) h = bc - gc;
|
if (rgb.x == M) h = bc - gc;
|
||||||
else if (rgb.y == M) h = 2 + gc - bc;
|
else if (rgb.y == M) h = 2 + rc - bc;
|
||||||
else h = 4 + gc - rc;
|
else h = 4 + gc - rc;
|
||||||
|
|
||||||
if (h < 0) h += 6;
|
if (h < 0) h += 6;
|
||||||
|
Loading…
Reference in New Issue
Block a user