Docsv2.12.12
Back to API Reference
Class

GradientUtil

static

Helpers for precomputing and evaluating gradient geometry. Shared between GradientModifier (face colour) and effect modifiers that support gradients (currently OutlineModifier); custom modifiers can use them too.

public static void Precompute()

Precomputes the projection / centre / radius for a single gradient range from its glyph bounding boxes. Call once per layout cycle.

public static float EvaluateT()

Maps a vertex position to a gradient t in [0, 1] using precomputed geometry.

public static Color32 EvaluateColor()

Evaluates the gradient at a vertex position and returns a Color32 whose alpha has been multiplied by alphaModulator (typically the source vertex's alpha byte, so the gradient inherits face fades).