rawTemperature static method

double rawTemperature(
  1. Hct color
)

Perceived warmth of a color: Chang & Ou (2026), the canonical model.

Signed distance from the color's CIE 1976 u'v' chromaticity to a "reference line" of neutral warmth passing through CIE Illuminant D75 (identified in the same research program as the most neutral white). Warmth = k * (au' + bv' + c) / sqrt(a^2 + b^2), with k=1298.3, a=2.2175, b=1, c=-0.8877.

Positive is warm, negative is cool, 0 on the neutral line. Purely chromaticity-based: no hue angle, chroma, or reference-white adaptation involved, and — unlike rawTemperature2004 / rawTemperature2018 — it is validated on near-white stimuli, so it remains meaningful at very high and very low tones.

Reference: Chang & Ou, "A Chromaticity-Based Warm-Cool Model Integrated With the Neutral White Locus", Color Research & Application 51 (2026), Equation 2. https://doi.org/10.1002/col.70063

Implementation

static double rawTemperature(Hct color) {
  final xyz = xyzFromArgb(color.toInt());
  final denom = xyz[0] + 15.0 * xyz[1] + 3.0 * xyz[2];
  if (denom.abs() < 1e-9) {
    return 0.0;
  }
  final u = 4.0 * xyz[0] / denom;
  final v = 9.0 * xyz[1] / denom;
  const k = 1298.3, a = 2.2175, b = 1.0, c = -0.8877;
  return k * (a * u + b * v + c) / math.sqrt(a * a + b * b);
}