Skip to content

anim-format (runtime format) / gradientUnitRatio

Function: gradientUnitRatio() ​

ts
function gradientUnitRatio(
   g, 
   x, 
   y
): number;

The colour offset at a point of unit gradient space, before spread (the editor's gradientRatioUnit, same maths).

Parameters ​

ParameterType
gPick<AnimGradient, "type" | "focal">
xnumber
ynumber

Returns ​

number

HereSplash — 2D animation for the web