Skip to content

Colours and light

The five palettes, colours of your own, and the light and lens a lamp is drawn with.

@cesarvenzac/lavav0.1.0

A lamp is four colours: the wax, the hot colour it glows toward where it's thin and lit, the liquid, and the bulb's light rising through the liquid from below.

Palettes

palette picks one of the five, each a wax on a dark liquid:

  • amber, the default: amber wax in a plum liquid, lit magenta.
  • magenta: magenta wax in a midnight liquid, lit blue.
  • ember: red wax in an oxblood liquid.
  • acid: green wax in a teal liquid.
  • violet: violet wax in an ink liquid, lit blue.

PALETTES holds them, PALETTE_NAMES their names.

Your own colours

colours lays any of the four over the palette's, as CSS colours. A var(--…) is read on the lamp's element, so a lamp can be drawn in your page's own tokens:

<Lava
  palette="violet"
  colours={{ wax: "var(--brand)", hot: "#ffe2b8" }}
/>

Choosing a palette afterwards replaces the colours given before it.

Light

  • glow (1): how brightly the bulb lights the wax from below.
  • bloom (1): how much the brightest light spills round itself.
  • gloss (1): how glossy the wax's skin is, from matte at 0.
  • exposure (1): how much light the picture takes in.

Lens

  • aperture (1): how shallow the focus is. Wax in front of and behind the focus blurs; at 0 everything is sharp.
  • focus (0): how deep the focus sits, from -0.5, further, to 0.5, nearer.
  • haze (1): how far wax further back sinks into the liquid's own light.
  • grain (1): the film's grain, which also keeps the dark liquid from banding.