vary

A color lightened or darkened per cell by a shade factor, alpha untouched.

vary(color: PaintSlot, factor: PaintSlot): PatternPaint

Import patterns from shaders/std and use patterns.vary.

factor is the shade output of a lattice word: 1 keeps the color, above 1 brightens, below 1 darkens. Use it on the cell fill so every tile reads slightly different.

Parameters

NameTypeNotes
colorPaintSlot
factorPaintSlot

Example

paint: strokeOver({fill: vary(p('cellColor'), field.shade), stroke: p('color'), mask: field.lines, space: p('colorSpace')})

See also

  • gridLines — Square grid lines drawn in a cellFrame, plus a per-cell shade for the fill.
  • hexLines — Honeycomb lines (pointy-top hexagons) drawn in a cellFrame, plus a per-cell shade.
  • brickCourses — A brick wall: staggered rows with mortar gaps, optional rotation and per-row drift.
  • strokeOver — Two colors mixed through a mask: fill where the mask is 0, stroke where it is 1.

Used by

BrickPattern, Grid, HexGrid, TriangularGrid