public static CIELab FromCIExyz(CIExyz xyzColor) { var transformedX = Transformxyz(xyzColor.x / CIExyz.RefX); var transformedY = Transformxyz(xyzColor.y / CIExyz.RefY); var transformedZ = Transformxyz(xyzColor.z / CIExyz.RefZ); var L = 116.0 * transformedY - 16; var a = 500.0 * (transformedX - transformedY); var b = 200.0 * (transformedY - transformedZ); return(new CIELab(L, a, b)); }
public static CIELab FromRGB(Color color) { return(FromCIExyz(CIExyz.FromRGB(color))); }