# Palettes and materials

A palette is the biggest single lever on how a build looks, and in Voxyl it is a separate layer
from the shape. Cells hold roles; the palette maps each role to a block. You can swap every
material without touching a cell, so treat material choice as design you can revisit, not a
commitment.

## At a glance

- Rule of thumb: three to five materials, each with a job: a primary (about 60% of what is seen),
  a secondary for structure and edges (about 30%), an accent for a few points of contrast (about
  10%). Glass, light and ground do not count.
- Choose for shade first, hue second, texture last. Adjacent roles need a visible step in
  light against dark, or they merge. A palette that works in greyscale works in dim light.
- Inside one role, vary a little (a lighter and a darker sibling) rather than a 50/50 mix.
- Roles are semantic names; the block is only a mapping, so you can try another palette without
  touching a cell. Check a block draws the way you expect (`describe_block`) before mapping it.

## Few materials, each with a job

Builders keep a build to **three to five materials**, used consistently across the whole thing.
Fewer looks flat. More looks like a junk pile. Give each a role and an approximate share of
what a viewer sees:

| Role | Share | Typical roles in Voxyl | Job |
| --- | --- | --- | --- |
| Primary | about 60% | `Wall`, `Floor` | The dominant surface. Calm, mid-value, slightly textured |
| Secondary | about 30% | `Frame`, `Roof`, `Trim`, `Plinth` | Structure and edges. Contrasts with the primary in **value** |
| Accent | about 10% | `Door`, `Shutter`, `Lamp`, `Banner`, `Accent` | A few points of contrast that pull the eye to the focal point |

Plus incidental roles that are not "materials" in the count: `Glass`, `Light`, `Ground`,
`Plant`. Variants of one role (a worn wall, a mossy wall) belong to the family of that role
([gradients-and-wear.md](gradients-and-wear.md)), not to the count.

This is a rule of thumb, not a law. A brutalist block can be one material with a lot of
massing. A palace can use seven. But a build with no dominant material and no accent has no
point of view.

## Choose for value first

Painters and builders agree on the order: **shade (light or dark) matters most, then hue (and
its undertone), then texture**. A palette that works in greyscale will work in colour. A
palette that only works because of hue falls apart in dim light.

- **Build a value structure.** Two or three clearly different steps: for example dark roof,
  mid walls, light trim; or dark base, light shaft, dark cap. Adjacent roles need a visible
  step in value, or they merge into a smear. In an `intent` capture, look at your roles
  squinting: you should be able to say which is darkest and which is lightest.
- **Darker reads as further, lighter as nearer.** Use a darker block for recesses and a
  lighter one for projections.
- **Keep hue under control.** Choose a base family (warm greys and browns, cool greys and
  blues) and keep most of the build in it. Use a complementary accent small: an orange door on
  a blue-grey wall, a verdigris roof on warm brick. Opposites make each other stand out; do
  not use them at equal area.
- **Muted base, saturated accent.** Large areas want lower saturation. Pure bright blocks
  (saturated concrete, wool, stained clay) work in small amounts, or in styles that want them
  (modern, playful, sci-fi).
- **Contrast surface as well as shade.** A smooth block next to a rough one (smooth stone
  trim around a cobble wall, polished frame in a rough field) looks crafted even at equal
  value.

## Use families and kits

Pick a primary block that comes with a kit: stairs, slabs, walls and variants (cracked, mossy,
chiseled, polished). Then every detail is made of "the same stuff" and the build feels
coherent. A wood family (planks, logs, stairs, slabs, fences, trapdoors, doors) is the
classic kit; stone, brick and quartz are others.

Use `find_blocks` to search the libraries the user has; the names carry the family.

```call-live
find_blocks {"query": "stone brick", "limit": 20}
```

Rank blocks by closeness to a colour when you know the colour you want:

```call-live
find_blocks {"near_color": "#8a8f99", "tolerance": 40, "limit": 15}
```

`describe_block` says whether a block is a plain cube or has its own model (a stair, a
fence, a pane), how it turns, and whether it glows. It is worth one call before you map a
role to something unusual.

The libraries differ by game version and by mods. Imported blocks keep the mod's own names,
including spaces. Decorative-block mods often carry many shades of the same material, which is
useful for ramps ([gradients-and-wear.md](gradients-and-wear.md)). Check what is there before
you design around a block.

## Setting a palette

```call
palette_edit {"palette": "Main", "semantics": [
  {"semantic": "Wall", "tint": "#a79f90"},
  {"semantic": "Trim", "tint": "#e0dccf"},
  {"semantic": "Accent", "tint": "#c8742c"}
]}
```

In practice you replace `tint` with `block`: `{"semantic": "Wall", "block":
"voxyl:stone_bricks"}`, with the ref copied from `find_blocks`. Setting `placement` (`stairs`,
`slab`, `log`, `horizontal`, `facing`, `torch`, `hopper`, `cube`) says how a whole block of that
role may turn: set it for stairs, slabs, logs and torches. `glow: true` makes an entry emit
light even if its block does not (blocks that emit, like glowstone and lanterns, always do), and
picks the glowing variant of a shape.

An undecided role (no block) draws as its tint. Leaving a role undecided while you are working
on shape is intended use, not a gap.

## Structure the palettes too

A project can hold several palettes that extend each other. Make one per part that should
change together, even an empty one: `Village`, then `Structure`, then `House`, then `Burned
House`. A change on a parent reaches every child that inherits it; a change on one house stays
on that house. One palette with more roles is just as valid when that much control is not
useful. See `guide` topic `semantics`.

## Looks: try options without changing the build

Each palette can have several **looks**, each a complete set of materials for its roles.
`capture` and `capture_sheet` take `looks` to render under other looks without changing what
the project is showing. That gives you a cheap way to offer choices. A new look starts empty
and **becomes the one showing**, and block, glow and tint edits go to the look that is
showing, so the order is: add the look, fill it in, switch back, then render it.

```call
look_add {"palette": "Main", "look": "Warm"}
```

```call
palette_edit {"palette": "Main", "semantics": [{"semantic": "Wall", "tint": "#c4a37a"}]}
```

```call
look_use {"palette": "Main", "look": "Original"}
```

```call
capture {"looks": [{"palette": "Main", "look": "Warm"}]}
```

(`Original` is the name a palette's first look has until you rename it; `palette_get` lists the
looks. `look_use` shows a look, `look_default` makes one the palette's default, which other
looks fall back to for roles they do not set.) Make two or three candidates whose **value structure**
differs, not only the hue, and show the user a `compare` sheet or one capture per look. The
user can switch looks in their editor afterwards; the cells never change.

## The check

Take a `textured` capture and ask:

- Can I name the primary, the secondary and the accent?
- Is there at least one clear value step between the wall and the roof, the wall and the
  trim, the wall and the ground?
- Is the accent small, and placed where I want the eye to go?
- Would it still work in greyscale?
- Are there more than five material families? Can two merge?
- Does the dominant block carry a kit, so the details match?
