dist.diamond

A diamond-shaped gradient spreading out from a center.

dist.diamond(slots: {center: PropRef; size: FieldScalar; rotation: FieldScalar; roundness: FieldScalar}): Field

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

0 at center, 1 at size (a fraction of the canvas height). roundness 0 is a sharp diamond and 1 is a square. rotation in degrees tilts it.

Parameters

NameTypeNotes
slots{center: PropRef; size: FieldScalar; rotation: FieldScalar; roundness: FieldScalar}

Example

paint: rampOver(rings(dist.diamond({center: p('center'), size: p('size'), rotation: p('rotation'), roundness: p('roundness')}), p('repeat')), stops(p('colorSpace')))

See also

  • rings — Repeats a field as concentric bands.

Used by

DiamondGradient