tone

Reshapes a 0–1 field with glow, contrast and balance controls, then flips it.

tone(
  field: Field,
  opts: {glow: FieldScalar; contrast: FieldScalar; balance: FieldScalar; invert: true},
): Field

Import paint from shaders/std and use paint.tone.

glow is a spread control: 5 leaves the field alone, lower values pull the bright parts into tight cores, higher values spread them into a wash. contrast scales around the middle, 1 is neutral. balance is 0–100 with 50 neutral. invert is always true: the result is flipped so the palette's first color lands where the field is high.

Parameters

NameTypeNotes
fieldField
opts{glow: FieldScalar; contrast: FieldScalar; balance: FieldScalar; invert: true}

Example

paint: rampOver(tone(scaledVolume(noiseField('mx3'), {scale: p('scale')}), {glow: p('intensity'), contrast: p('contrast'), balance: p('balance'), invert: true}), stops(p('colorSpace')))

Tip. Raising balance pushes more of the canvas toward the first color.

See also

  • threshold — Turns a signed field (−1 to 1) into a soft 0–1 mask.
  • noiseField — A field of smooth noise in the chosen flavor.

Used by

Plasma