# Colour and themes

> Colour roles instead of loose colours, a light and a dark theme designed on purpose, and contrast checked for you.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://design.docs.sypnia.com/guide/color-and-themes/

For agents: Colour roles (tokens color.*): surface, surface-raised, surface-sunken, ink, ink-quiet, line, accent, on-accent, focus, success, warning, danger, info, plus brand extras (e.g. color.crust). Each role has a light and a dark value; dark is designed, not inverted. Contrast: text ≥ 4.5:1, large text and UI parts ≥ 3:1, focus ring ≥ 3:1 against neighbours (WCAG 2.2 AA); checked when tokens build and in design check. Theme follows the system by default; the guide decides whether a switch is offered. Status colours never carry meaning alone (icon or words too). Charts get a categorical palette derived from the guide.

## Roles, not loose colours

Your app never uses «brown» or `#3B2A1E` directly. It uses **roles**: what a colour is for. Each role has one value in the light theme and one in the dark theme.

| Role                                   | Used for                                | La Espiga, light                           | La Espiga, dark              |
| -------------------------------------- | --------------------------------------- | ------------------------------------------ | ---------------------------- |
| `surface`                              | the page                                | flour white                                | dark rye                     |
| `surface-raised`                       | cards, sheets, menus                    | warm white                                 | a step lighter than the page |
| `surface-sunken`                       | fields, wells                           | light crust                                | a step darker                |
| `ink`                                  | text                                    | dark brown                                 | cream                        |
| `ink-quiet`                            | secondary text                          | soft brown                                 | soft cream                   |
| `line`                                 | borders and dividers                    | light brown                                | dark brown                   |
| `accent`                               | the one action that matters on a screen | wheat yellow                               | bright wheat                 |
| `on-accent`                            | text on the accent                      | dark brown                                 | dark brown                   |
| `focus`                                | the keyboard focus ring                 | a deep blue that stands out from the brand | a light blue                 |
| `success`, `warning`, `danger`, `info` | outcomes and alerts                     | green, amber, brick red, blue              | lighter versions             |

A brand may add roles of its own (La Espiga has `crust`, for the pick-up code), each with a reason in the guide.

## Dark is designed, not inverted

The dark theme gets its own values, chosen so the brand still feels like itself at night: surfaces are warm, not grey; the accent is a little brighter; shadows become light borders. The guide shows both themes side by side.

The theme follows the person's system setting. Whether the app also offers a switch is a decision in the guide.

## Contrast is checked for you

Every pair that appears together is checked when tokens are built and again by `design check`, against WCAG 2.2 level AA:

| Pair                                                         | Minimum |
| ------------------------------------------------------------ | ------- |
| text on its surface                                          | 4.5 : 1 |
| large text (24 px, or 19 px bold), icons and control borders | 3 : 1   |
| the focus ring against what is around it                     | 3 : 1   |

A proposal that fails is not shown to you; a change you make by hand that fails is reported with the pair and the ratio.

## Colour never speaks alone

Success, warning and danger always come with words or an icon, so a person who does not see the colour still gets the message. Charts use a palette derived from the guide, checked so neighbouring colours stay distinguishable.
