# Lava: Colours and light

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

Source: https://cesarvenzac.com/lava/docs/colours-and-light

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:

```tsx
<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.

## Lava's docs

- [Overview](https://cesarvenzac.com/lava.md): A lava lamp for any box: thick 3D wax glowing in a dark liquid, shot through a long lens.
- [Getting started](https://cesarvenzac.com/lava/docs/getting-started.md): Install Lava and fill a box with a lava lamp: in React, or in any element, alone or behind content.
- [Colours and light](https://cesarvenzac.com/lava/docs/colours-and-light.md): The five palettes, colours of your own, and the light and lens a lamp is drawn with.
- [Motion and the page](https://cesarvenzac.com/lava/docs/motion-and-the-page.md): How the wax moves, any moment drawn on its own, and how a lamp behaves on a page.
- [API reference](https://cesarvenzac.com/lava/docs/api.md): Every function, option and type Lava exports.
