Color_Interpolation module

Interpolation

structSource

How generate_color_samples blends: the color_space the blend happens in (.RGB, .HSV or .OKLAB), the geometry that shapes the blend between two keys (.LINEAR, .QUADRIC for an ease in and out, .HERMITE for a smoothstep) and wrapping, which blends the last key into the first across the seam instead of holding the end colors. The default value is RGB, linear, not wrapping.

ExampleOpen in playground ↗
settings := Interpolation.{ .OKLAB, .HERMITE, true };
assert(settings.color_space == .OKLAB && settings.wrapping);
assert(Interpolation.{}.geometry == .LINEAR && !Interpolation.{}.wrapping);

Fields

color_space: enum u8 { RGB :: 0; HSV :: 1; OKLAB :: 2; }
geometry: enum u8 { LINEAR :: 0; QUADRIC :: 1; HERMITE :: 2; }
wrapping: := false

See also