Papers
Topics
Authors
Recent
Search
2000 character limit reached

Chroma-gated, differentiable OKLCH interpolation: Continuous Oklab fallback for color-cast reduction

Published 13 Jun 2026 in eess.IV, cs.CV, and cs.GR | (2606.15352v1)

Abstract: OKLCH -- the cylindrical (lightness, chroma, hue) form of Ottosson's Oklab color space -- is the interpolation space recommended by CSS Color 4 for gradients and color-mix(), and it is now broadly deployed. Its polar parameterization, however, casts color near the neutral axis in two ways: (1) an inter-hue detour between two chromatic endpoints that sweeps through an unintended hue (blue to yellow visibly passing through green), and (2) an off-line bow when one endpoint is achromatic. Existing remedies are uniformly two-valued -- a threshold switch that fires only at an achromatic endpoint -- so they address only (2); on chromatic pairs every one of them reduces to raw OKLCH, leaving the (1) inter-hue cast untreated. We introduce Continuous Oklab fallback (COFb), a one-parameter, differentiable chroma gate w(C)=C<sup>n/(C<sup>n+σ<sup>n)w(C)=C<sup>n/(C<sup>n+σ<sup>n) that continuously blends the OKLCH path toward the linear Oklab path as chroma falls. A single gate reduces the (1) cast that the two-valued family leaves untreated and unifies the handling of (1) and (2) without any endpoint test. We characterize a cast-hue trade-off frontier, adopt a default (n=1n=1, the rational Michaelis-Menten form; σ0.19σ\approx0.19 for a typical sRGB palette, from a normalization-independent cast-half criterion), and verify the gate's properties symbolically. At the default, COFb halves the inter-hue path detour (mean lateral deviation -49.5%, chroma-weighted hue excursion -35.5%). We also state the method's limits: on (2) alone the two-valued switch remains better, and like any Cartesian blend COFb does not preserve chroma. In deployment, COFb runs entirely in plain Oklab (a,b) to sRGB, so it serves as a fallback that delivers the same cast-reduced gradients where modern CSS color interpolation (color-mix(in oklch) and the like) is unavailable -- older engines, image and video pipelines, or GPU shaders.

Authors (1)

Summary

  • The paper introduces Continuous Oklab Fallback (COFb), which blends raw OKLCH with linear Oklab using a differentiable chroma gate and reduces mean inter-hue lateral deviation by 49.5% at σ≈0.19.
  • COFb addresses both inter-hue and achromatic-endpoint casts without branching, reducing chroma-weighted hue excursion from 20.3° to 13.1° for chromatic pairs while retaining a continuous, GPU-friendly formulation.
  • The method does not fully outperform hard achromatic switching or preserve chroma, and its optimal σ depends on gamut and content, leaving perceptual validation and adaptive scaling as open questions.

The problem: two casts from one singularity

OKLCH, the cylindrical (lightness, chroma, hue) form of Ottosson's Oklab space, is the interpolation space recommended by CSS Color 4 for gradients and color-mix(), and it is deployed across major browsers and CSS tooling. Its polar parameterization is singular on the neutral axis: at zero chroma the hue h=atan2(b,a)h=\operatorname{atan2}(b,a) is undefined, and near the axis small displacements in (a,b)(a,b) produce arbitrarily large hue changes. Uchida's paper separates the resulting artifacts into two named cases:

  • (1) Inter-hue cast: both endpoints chromatic but on opposite sides of the neutral axis (e.g., blue → yellow). The constant-radius hue arc detours around the origin, bulging in chroma and sweeping through an unintended hue—blue → yellow visibly passes through green.
  • (2) Achromatic-endpoint cast: one endpoint achromatic (e.g., green → black). Its hue is genuinely undefined, yet a value is carried forward, bowing the path off the chromatic-to-neutral line.

The paper's central observation is that all existing remedies—the CSS missing-component mechanism (issue #6107) and ColorAide's is_achromatic() threshold—are two-valued: a hard switch that fires only when an endpoint is judged achromatic. On chromatic pairs every such method reduces exactly to raw OKLCH, so artifact (1) is a blind spot of the entire existing family.

Method: Continuous Oklab fallback

COFb computes both the raw OKLCH path and the straight linear-Oklab segment in the (a,b)(a,b) plane, then blends them point-by-point with a chroma gate evaluated at the interpolated chroma C(t)C(t) along the OKLCH path:

w(C)=CnCn+σn,a(t)=waoklch(t)+(1w)alin(t),w(C)=\frac{C^{n}}{C^{n}+\sigma^{n}}, \qquad a(t)=w\,a_{\text{oklch}}(t)+(1-w)\,a_{\text{lin}}(t),

with lightness interpolated linearly and shared. Because the gate reads the path's own chroma at each tt, it engages wherever chroma is low—at an achromatic endpoint and along an inter-hue detour alike—with no endpoint test or branching. As σ0\sigma\to 0 the family recovers raw OKLCH; as σ\sigma grows it collapses to linear Oklab, so COFb spans the two standard choices continuously where the existing fallback switches discretely between them.

All gate properties are verified symbolically with SymPy: w(0+)=0w(0^+)=0, w(σ)=1/2w(\sigma)=1/2, monotonicity, analyticity on (a,b)(a,b)0, and the (a,b)(a,b)1-dependent endpoint slope (a,b)(a,b)2 for (a,b)(a,b)3, (a,b)(a,b)4, (a,b)(a,b)5. The default is (a,b)(a,b)6 (the rational Michaelis–Menten form (a,b)(a,b)7), chosen for three reasons: finite endpoint slope ((a,b)(a,b)8 up to the neutral axis), a GPU-friendly rational form with closed-form inverse (a,b)(a,b)9, and consistency with the author's Oklch+ toolset (Uchida, 3 Jun 2026). The alternative (a,b)(a,b)0 (the Naka–Rushton exponent fit to COMBVD data in Oklch+) differs only at the error level, so adopting (a,b)(a,b)1 carries no trade-off cost.

Evaluation

Metrics are computed directly in the Oklab (a,b)(a,b)2 plane over five endpoint pairs split into the two groups: lateral deviation from the chord (primary metric), excess chroma, and chroma-weighted hue excursion. Three findings stand out.

On chromatic pairs, all existing methods are numerically identical to raw OKLCH—their achromatic test never trips—and share its full cast (e.g., Blue→Yellow: lateral deviation 0.1768, hue excursion 25.42°). COFb is the only method compared that acts here, halving the group-mean lateral deviation from 0.1378 to 0.0697 (−49.5%) and reducing chroma-weighted hue excursion by 35.5%. Excess chroma nearly coincides with lateral deviation on these pairs, confirming the detour is essentially a pure radial bulge.

Method (1) lat. dev. (1) hue exc. (2) lat. dev. (2) hue exc.
Raw OKLCH 0.1378 20.3° 0.0821 40.0°
NaN-inherit / Two-valued 0.1378 20.3° 0.0000 0.0°
COFb ((a,b)(a,b)3, (a,b)(a,b)4) 0.0697 13.1° 0.0313 11.2°

On achromatic pairs, the two-valued methods remain superior in isolation, driving lateral deviation to exactly zero; COFb improves substantially over raw OKLCH (0.0821 → 0.0313) but does not reach zero. The paper states this plainly rather than claiming uniform superiority: COFb's contribution is unification of (1) and (2) under one differentiable expression, not dominance on either case alone.

A parameter sweep exposes a cast–hue trade-off frontier whose ideal corner (full cast removal plus full hue control) is unreachable. The default (a,b)(a,b)5 comes from a normalization-independent cast-half criterion (cast = half the raw baseline); a hue-priority operating point sits at (a,b)(a,b)6. A frontier-knee estimate ((a,b)(a,b)7) is consistent but grid-dependent and not counted as independent corroboration. A cross-check confirms the gate-based hue-retention proxy tracks actual paths almost perfectly (Pearson (a,b)(a,b)8 against path-based retention), so the trade-off is not a proxy artifact.

Limitations and open questions

The paper is explicit about boundaries. First, artifact (2) taken alone is better served by the existing switch, which reaches exactly zero lateral deviation; closing that residual gap within a continuous formulation remains open. Second, like any Cartesian blend, COFb does not preserve chroma—the path grays slightly near the neutral axis—and a chroma-preserving variant would require a non-Cartesian construction outside this work's scope. Third, no perceptual optimality is claimed: (a,b)(a,b)9 is anchored to a geometric criterion for a moderate-chroma sRGB-typical palette, and because C(t)C(t)0 is a threshold in chroma units, more saturated content or wider gamuts shift the optimum upward; content-adaptive C(t)C(t)1 scaling is left uncharacterized. Fourth, while the gate is C(t)C(t)2 in chroma at the neutral axis for C(t)C(t)3, the time-derivative behavior of the rendered path at an achromatic endpoint (where C(t)C(t)4 combines with the gate response) has not been exhaustively characterized. Finally, whether the geometric cast reduction corresponds to observer-judged improvement awaits a perceptual study, and step-size uniformity along the path lies on a separate evaluation axis not addressed here.

Conclusion

This paper identifies a genuine gap in deployed color-interpolation practice: the two-valued achromatic fallbacks specified for CSS leave the inter-hue cast entirely untreated, since they reduce to raw OKLCH whenever both endpoints are chromatic. Continuous Oklab fallback closes that gap with a single differentiable chroma gate that halves the inter-hue detour at its recommended default (C(t)C(t)5, C(t)C(t)6), unifies both artifacts without branching, and runs entirely in plain Oklab-to-sRGB arithmetic—making it usable as a fallback in engines, pipelines, and shaders lacking native OKLCH interpolation. Its costs—a residual achromatic gap versus the two-valued switch and slight near-axis graying—are stated alongside the results, positioning COFb as a continuous extension of missing-component handling rather than a replacement for it.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.