public enum GradientSpaceWhich space a gradient's stops are interpolated in.
Remarks
⚠ Three answers coexisted before this enum existed, and none of them was wrong on its own terms. Vixen paints in linear RGB and lerped there; CSS's default for a gradient with no in <space> hint is sRGB; and Tailwind v4 emits in oklab on every gradient it generates. Picking one and calling it "the" answer would have made two of the three sources of gradients in this engine draw something their author did not write, so the space travels with the gradient instead.
⚠ Linear is zero because it is what the shader already did. A gradient built through Vertical — the engine's own programmatic API, which has no CSS text and therefore no hint to honour — keeps interpolating exactly where it did, so growing UiShape moved no committed picture. Only the CSS path chooses, and it chooses by reading what the author wrote.
⚠ The choice is most visible at the midpoint, which is the only place it matters. Two complements — the palette's blue and its amber, say — meet at a desaturated grey in linear RGB, at a muddier and darker grey in sRGB, and at a colour that still reads as a colour in Oklab. Since the engine's default palette now ships as Tailwind v4.3.3's, quoted oklch, interpolating two of its swatches in linear RGB throws away the uniformity they were chosen for at precisely the pixel where it shows.
Fields and properties (3)
LinearLinear RGB, componentwise. What the engine paints in and what it lerped in before.
SrgbsRGB, componentwise. CSS's default when a gradient carries no interpolation hint.
OklabOklab. Perceptually uniform, and what in oklab asks for.
Used by (8)
- BackgroundGradientVixen.Ui
- BoxStyleVixen.Ui
- GradientReaderVixen.Ui
- GradientTestsVixen.Ui.Tests
- SoftwareUiRasterizerVixen.Ui.Testing
- UiBoxAgreementTestsVixen.Graphics.Golden.Tests
- UiShapeVixen.Ui
- UiShapeLayoutTestsVixen.Ui.Tests