luvToXyz static method
XYZ coordinates are ranging in 0;1
.
@param tuple An array containing the color's L,U,V values.
@return An array containing the resulting color's XYZ coordinates.
Implementation
static List<double> luvToXyz(List<double> tuple) {
double L = tuple[0];
double U = tuple[1];
double V = tuple[2];
if (L == 0) {
return [0, 0, 0];
}
double varU = U / (13 * L) + refU;
double varV = V / (13 * L) + refV;
double Y = lToY(L);
double X = 0 - (9 * Y * varU) / ((varU - 4) * varV - varU * varV);
double Z = (9 * Y - (15 * varV * Y) - (varV * X)) / (3 * varV);
return [X, Y, Z];
}