Theme
With
SYSTEM, define both palettes. A user in dark mode with only a light palette set
gets the SDK’s dark defaults, which almost certainly are not your brand.
Colors
Hex strings ("#RRGGBB"). Every field is optional: leaving one unset falls back to the SDK
default, and an empty palette is valid.
Overriding one color
This is the mistake people hit first. A palette you build yourself replaces the defaults rather than merging into them: every field you leave out is unset, not the SDK default. To change one color and keep the rest, start from the defaults:On-color pairs
EveryonX color is what renders on top of X. They travel in pairs, and breaking a
pair is how you end up with unreadable text: setting primary to a dark blue without
setting onPrimary to something light leaves dark-on-dark button labels.
The SDK does not compute a contrasting color for you. Set both halves.
Aim for at least 4.5:1 contrast between each pair. The flow is used by people
photographing a document in poor lighting, sometimes one-handed, often outdoors —
legibility matters more here than in most of your app.

