---
title: "Recipe: a brand in Light, Dim and Black"
description: "An app's own colours are its design, app.forma beside app.contract (LLP 1121)."
modificationDate: "2026-11-14"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: a brand in Light, Dim and Black

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/recipes/forma: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

An app's own colours are its design, `app.forma` beside `app.contract` (LLP
1121). Rows name its tokens as they name roles; a mode the person picks (Dim or
Black for dark) is an app axis, set by `setMode` and held by a pin.

```prompt Give my app its brand colors
Give the Exact app in this folder its own brand colors in app.forma, with a dark style the person picks. Use https://github.com/expo/exact/blob/main/docs/recipes/forma.md as the source for each step. The Exact checkout has the same page at docs/recipes/forma.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me.
2. If I did not give the brand's colors, ask me for them. Do not invent a brand. Ask me whether the person picks a dark style (for example Dim or Black) or the app follows the system only.
3. Write app.forma beside app.contract: a `theme` of tokens with `light-dark()` values and, for a picked dark style, an `axes` line with `under scheme=dark` and a `when` line for each other mode. Mark a one-color token `scheme=fixed`.
4. In app.contract, name the tokens where a color is the brand's, and keep the platform's roles everywhere else. Set a mode with `setMode("<axis>", "<value>")`. A preview that always shows one mode is a pin, `-exact-mode="<axis>=<value>"`, with `color-scheme="dark"` when it is dark.
5. Run `bun exact.mjs forma check .`, then `bun exact.mjs forma eval . --mode <axis>=<value>` for each mode, and `bun exact.mjs forma fmt .`.
6. Add a test in app.test.contract that taps each mode button and checks the screen, and one that uses `prefer mode <axis>=<value>` after `clock data`.
7. Follow the platform checks in docs/start-here.md (`bun exact.mjs docs platform checks`) for the targets in the app's AGENTS.md and app.json until they pass. Read the reports, including counted findings; a zero exit code alone does not mean clean. Fix the app, not the test. If a finding stays after three rounds of fixes, or the app had it before you changed anything, record it (step 8) and report it; do not keep trying.
8. When a doc was wrong or missing, or a step needed a workaround, read `bun exact.mjs feedback status`. Under `never`, keep no note. Otherwise record it: `bun exact.mjs feedback note "<what happened>"`, which goes to Expo only as that status says. Do not change the policy; tell me how many notes you kept.
9. Tell me the tokens and modes, what forma check, the tests and verify reported, and the launch command for each target platform.
```

```forma
forma brand

axes
  dark-style = black | dim  under scheme=dark

theme
  surface.page = light-dark(#ffffff, #000000)
    when dark-style=dim: light-dark(#ffffff, #15202b)
  surface.card = light-dark(#f1f3f5, #16181c)
    when dark-style=dim: light-dark(#f1f3f5, #1e2732)
  text.primary = light-dark(#0f1419, #e7e9ea)
    when dark-style=dim: light-dark(#0f1419, #f7f9f9)
```

```contract
component App
  action dim
    setMode("dark-style", "dim")
  action black
    setMode("dark-style", "black")
  view
    column background-color="surface.page" color="text.primary" padding=16 gap=12
      row gap=8
        button press=dim testId="dim"
          text "Dim"
        button press=black testId="black"
          text "Black"
      column background-color="surface.card" padding=12 testId="card"
        text "Follows the window"
      column -exact-mode="dark-style=black" color-scheme="dark" background-color="surface.card" padding=12 testId="preview"
        text "Always Black"
```

What to know:

- **Names, not values.** `bun exact.mjs forma check .` checks the design;
  `forma eval . --mode dark-style=dim` prints each token in that mode;
  `forma fmt .` formats it.
  `no-tells` reads the design: a token is not a literal.
- **An axis is the app's.** `under scheme=dark` keeps the light side; a `when`
  line gives the mode's value; the first value is the default.
- **A pin** (`-exact-mode="axis=value"`) holds its subtree in a mode; inherited
  text inside takes the pin's value. `axis:value` is refused. A pin picks the
  app's mode, not the scheme: a preview that is always dark says
  `color-scheme="dark"` too.
- **Drive it** with `prefer mode dark-style=dim`, after `clock data`: an app
  that restores a kept mode at launch overrides an earlier one. `layout <id>`
  shows the token beside each row's value.
- **One colour on purpose** (white ink on the brand fill): `ink.on-brand =
  #ffffff  scheme=fixed`; an unmarked one-colour token is warned once, at its
  line here.
- **One way to write a colour:** a role if the platform has one, a token if it
  is the brand: `ink`, or `var(--ink)`. `forma import css <file>` writes a
  stylesheet's here.
- **The brand's states** (the focus ring, selection, a filled button's hover,
  a sheet's corners, a row's `:hover`): `contract-for-agents.md`, Forma.
- **Edit it while it runs** (development only): the dev loop serves
  `/__forma`; `bun exact.mjs forma op <url> '{"method":"describe"}'` reads,
  and `history` and `revert` read and undo token edits. `bun exact.mjs forma
  tool .` opens the design tool on it (LLP 1122) at `http://127.0.0.1:7740`,
  one per machine: to switch, ctrl-c it and run `forma tool <other app>`
  (`--via <its URL>` when its dev loop runs).
  Reference: `docs/forma-protocol.md`.
