6 private const float Epsilon = 0.008856f;
8 private const float Kappa = 903.3f;
25 float num =
PivotXyz(xyz.
X / whiteReference.
X);
26 float num2 =
PivotXyz(xyz.
Y / whiteReference.
Y);
27 float num3 =
PivotXyz(xyz.
Z / whiteReference.
Z);
30 L = Math.Max(0f, 116f * num2 - 16f),
31 A = 500f * (num - num2),
32 B = 200f * (num2 - num3)
40 return (903.3f * n + 16f) / 116f;
47 return Mathf.Pow(n, 1f / 3f);
57 X = num * 0.4124f + num2 * 0.3576f + num3 * 0.1805f,
58 Y = num * 0.2126f + num2 * 0.7152f + num3 * 0.0722f,
59 Z = num * 0.0193f + num2 * 0.1192f + num3 * 0.9505f
65 return ((n > 0.04045f) ? Mathf.Pow((n + 0.055f) / 1.055f, 2.4f) : (n / 12.92f)) * 100f;
static Lab XyzToLab(Xyz xyz)
static Xyz RgbToXyz(Color rgb)
static Lab RgbToLab(Color rgb)
static float PivotXyz(float n)
static float CubicRoot(float n)
static readonly Xyz WhiteReference
static float PivotRgb(float n)