Shaders / Primitives / Tone

Tone

A tone function of the cell, given by the page.

Drawn with
CPU only
Chain
tone
Code
@forgeron/shaders: toneMeta, toneCpu
/01 → What it is
  • `data.tone(x, y)` per cell, row 0 at the top: the mask of a title, a gradient, a shape.
  • What `ditherPath` runs at build time: a tone function through the ordered dither to an SVG path.
  • CPU only: a preset with it runs on a 2D canvas.
/02 → In the examples
ExampleChain
Titletone → ordered → reveal → palette
/03 → Versions
  • /01 2×2ditherPath(64, 16, (x) => x / 63, 2)
  • /02 4×4ditherPath(64, 16, (x) => x / 63, 4)
  • /03 8×8ditherPath(64, 16, (x) => x / 63, 8)
/04 → Use it
/01 → In a preset, with its defaults
{
  "type": "tone"
}
/02 → One side per page
import { toneMeta, toneCpu } from "@forgeron/shaders";

// toneMeta: description and params schema (validation, the editor)
// toneCpu: the CPU side, for bindChain then runCpu
API → Options

No settings.