|
| float | GetValue () const |
| | value as a fraction of a full turn (see EncodeAngle).
|
| Gradient & | WithColorSpace (ColorSpace cs) |
| | Sets the space the stops are interpolated in; returns *this.
|
| ColorSpace | GetColorSpace () const |
| | Space the stops are interpolated in.
|
| bool | AddStop (const color4f &color, float offset) |
| | Adds a stop at offset (0..1); false when all kMaxStops are in use.
|
| bool | AddStop (const color4b &color, float offset) |
| | Adds a stop at offset (0..1); false when all kMaxStops are in use.
|
| void | ClearStops () |
| | Removes all stops.
|
| uint8_t | StopCount () const |
| | The stops in use: stopCount, but never past the stop array (a gradient built in code can set stopCount to anything).
|
| bool | IsEmpty () const |
| | No stops, or type None: nothing to draw.
|
| void | WriteTo (std::span< color4b > out) const |
| | Samples the gradient evenly across out, sRGB encoded.
|
| bool | operator== (const Gradient &other) const noexcept |
|
| static Gradient | Solid (const color4f &color) |
| | One color: two equal stops at 0 and 1.
|
| static Gradient | Solid (const color4b &color) |
| | One color: two equal stops at 0 and 1.
|
| static Gradient | Linear (const color4f &c0, const color4f &c1) |
| | Two stops at 0 and 1.
|
| static Gradient | Linear (const color4b &c0, const color4b &c1) |
| | Two stops at 0 and 1.
|
| static Gradient | Linear (const color4f &c0, const color4f &c1, const color4f &c2) |
| | Three stops at 0, 0.5 and 1.
|
| static Gradient | Linear (const color4b &c0, const color4b &c1, const color4b &c2) |
| | Three stops at 0, 0.5 and 1.
|
| static Gradient | Linear (const color4f &c0, const color4f &c1, const color4f &c2, const color4f &c3) |
| | Four stops at 0, 0.25, 0.5 and 1.
|
| static Gradient | Linear (const color4b &c0, const color4b &c1, const color4b &c2, const color4b &c3) |
| | Four stops at 0, 0.25, 0.5 and 1.
|
| static uint16_t | EncodeAngle (float angleDegrees) |
| | Angle as a fraction of a full turn in [0, 1), wrapping negative angles (-90deg == 270deg).
|
| static Gradient | Linear (float angleDegrees=0.0f) |
| | An empty linear gradient at an angle in degrees; add stops with AddStop.
|
| static Gradient | Radial (float angleDegrees=1.0f) |
| | An empty radial gradient; add stops with AddStop.
|
Up to kMaxStops color stops plus an angle and interpolation color space.
Registering a color style bakes it into the gradient atlas.
| uint16_t tachyon::Gradient::EncodeAngle |
( |
float | angleDegrees | ) |
|
|
inlinestatic |
Angle as a fraction of a full turn in [0, 1), wrapping negative angles (-90deg == 270deg).
Scaled by an even number so that 90 degrees is exactly 0.25, 180 is 0.5, etc.; the visual style turns this into a 2x2 transform.