in binding/SkiaSharp/SKColorF.cs [108:159]
public static SKColorF FromHsv (float h, float s, float v, float a = 1f)
{
// convert from percentages
h = h / 360f;
s = s / 100f;
v = v / 100f;
// RGB results from 0 to 1
var r = v;
var g = v;
var b = v;
// HSL from 0 to 1
if (Math.Abs (s) > EPSILON) {
h = h * 6f;
if (Math.Abs (h - 6f) < EPSILON)
h = 0f; // H must be < 1
var hInt = (int)h;
var v1 = v * (1f - s);
var v2 = v * (1f - s * (h - hInt));
var v3 = v * (1f - s * (1f - (h - hInt)));
if (hInt == 0) {
r = v;
g = v3;
b = v1;
} else if (hInt == 1) {
r = v2;
g = v;
b = v1;
} else if (hInt == 2) {
r = v1;
g = v;
b = v3;
} else if (hInt == 3) {
r = v1;
g = v2;
b = v;
} else if (hInt == 4) {
r = v3;
g = v1;
b = v;
} else {
r = v;
g = v1;
b = v2;
}
}
return new SKColorF (r, g, b, a);
}