dist.linear

A straight gradient from one point to another.

dist.linear(slots: {from: PropRef; to: PropRef; angle: FieldScalar}): Field

Import paint from shaders/std and use paint.dist.linear.

0 at from, 1 at to. angle in degrees turns the whole gradient about the midpoint.

Parameters

NameTypeNotes
slots{from: PropRef; to: PropRef; angle: FieldScalar}

Example

paint: rampOver(dist.linear({from: p('start'), to: p('end'), angle: p('angle')}), stops(p('colorSpace')), {edges: p('edges')})

See also

  • rampOver — A paint that colors each pixel by looking its field value up in a palette.

Used by

LinearGradient