RgbaGradient
A color ramp of 8-bit sRGB stops with alpha — rendering-revamp §RVG-2.
Declared in src/libs/libstyle/RgbaGradient.hpp.
Detailed description
The value type of the gradients a material evaluates, and of the RGBA editor in libwidgets. libpaint's spectral gradient is a different type, because its stops are spectra and its blend is spectral (gradients §GR-4.2); the two share the editor, not the value.
The sampling rule is the one the material GLSL follows (§RVG-4), so the editor and a surface show the same color:
- Convert each stop from sRGB to linear light.
- Interpolate linearly between the two stops around
t, alpha too. - Below the first stop and above the last, hold the end color.
Invariants, which isValid() checks: at least two stops, the first at 0, the last at 1, positions strictly increasing.