Fix oklch conversion

We want to normalize angles to be in [0, 360).
This commit is contained in:
Matthias Clasen 2024-05-31 20:17:37 -04:00
parent fc45d90834
commit fa3a72c8f6

View File

@ -307,7 +307,10 @@ gtk_oklab_to_oklch (float L, float a, float b,
{
*L2 = L;
*C = sqrtf (a * a + b * b);
*H = atan2 (b, a);
*H = RAD_TO_DEG (atan2 (b, a));
*H = fmod (*H, 360);
if (*H < 0)
*H += 360;
}
void