Skip to main content

Colors

Components never take a color. They ask the theme for a role (primary, surfaceContainerLow, onSurface, …), and a skin decides which role goes where. That is what lets one theme work in every skin.

From a seed​

CamoColors.fromSeed builds a full light or dark scheme from one color:

val colors = CamoColors.fromSeed(
primary = Color(0xFF0B57D0),
// optional: secondary, tertiary, error, success, warning, info, neutral
dark = false,
)
  • secondary and tertiary are derived from the primary's hue unless you pass them.
  • error, success, warning and info have sensible defaults.
  • neutral gives true grays by default. Pass your primary for brand-tinted surfaces, the Material style.

The roles​

GroupRoles
Brandprimary, onPrimary, primaryContainer, onPrimaryContainer, and the same four for secondary and tertiary
Statuserror, success, warning, info, each with on…, …Container and on…Container
Surfacessurface, surfaceContainerLowest, surfaceContainerLow, surfaceContainer, surfaceContainerHigh, surfaceContainerHighest
ContentonSurface, onSurfaceVariant
Linesoutline, outlineVariant
Inverse and overlayinverseSurface, inverseOnSurface, inversePrimary, scrim

The status colors are the tones of the components: tone = Tone.Error on a button uses the error family.

Using a color in your own code​

Read it from the theme so your widgets follow the skin and dark mode:

val colors = Camouflage.colors
Box(Modifier.background(colors.surfaceContainerLow))

Contrast​

A seed can produce pairs that are hard to read. Run validate() after you pick a brand color.