hexLines

Honeycomb lines (pointy-top hexagons) drawn in a cellFrame, plus a per-cell shade.

hexLines(slots: {
    frame: PatternPaint
    thickness: PropRef
    softness: PropRef
    variation: PropRef
}): {lines: PatternPaint; shade: PatternPaint}

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

Returns lines (1 on a line) and shade (a brightness factor around 1 for vary). thickness 1 draws lines about 2% of a cell wide; 0 draws none. softness 0–1 blurs the lines. variation 0–1 sets how far shade strays from 1. Draw it with the 'clockwise' convention.

Parameters

NameTypeNotes
slots`{
frame: PatternPaint
thickness: PropRef
softness: PropRef
variation: PropRef

}` | |

Example

const field = hexLines({frame: cellFrame({cells: p('cells'), rotation: p('rotation'), convention: 'clockwise'}), thickness: p('thickness'), softness: p('softness'), variation: p('variation')})

See also

  • cellFrame — The shared coordinate system of a tiled pattern: how many cells fit down the canvas height and how far the whole lattice is rotated.
  • gridLines — Square grid lines drawn in a cellFrame, plus a per-cell shade for the fill.
  • isoCubeFaces — Tumbling blocks: three shaded rhombus faces per hexagon that read as a field of 3D cubes.
  • vary — A color lightened or darkened per cell by a shade factor, alpha untouched.

Used by

HexGrid