1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-05 15:56:00 +02:00

HSL grayscale NaN fix

This commit is contained in:
Brian Fiete 2024-02-22 06:50:32 -05:00
parent 50a8ff4332
commit e1bd728326

View file

@ -141,7 +141,9 @@ namespace Beefy.gfx
h = -1;
return;
}
if (r == max)
if (delta == 0)
h = 0;
else if (r == max)
h = (g - b) / delta; // between yellow & magenta
else if (g == max)
h = 2 + (b - r) / delta; // between cyan & yellow