Skill Wiki v0.1.0
rule @android-compose/rule-color-roles-not-raw-hex

Color Roles Not Raw Hex

Material 3 defines 30+ semantic color *roles* — `primary`, `onPrimary`, `surface`, `onSurfaceVariant`, `error`, `outline`, etc. — exposed in Compose as `MaterialTheme.colorScheme.<role>`.…

Skill
@android-compose
Domain
android-compose
Version
0.1.0
Quality
4.0
Edges
3 out · 3 in
Tokens
140/326/343
$ prime install @android-compose/rule-color-roles-not-raw-hex

Projection

Always in _index.xml · the agent never has to ask for this.

ColorRolesNotRawHex [rule] v0.1.0

Material 3 defines 30+ semantic color rolesprimary, onPrimary, surface, onSurfaceVariant, error, outline, etc. — exposed in Compose as MaterialTheme.colorScheme.<role>. Components and screens reference roles. The role-to-hex mapping lives in the theme and changes between light/dark, dynamic-color (Material You), high-contrast, and per-app brand schemes. Hard-coding a hex value bypasses every one of those swaps and breaks the moment a user toggles dark mode or dynamic color.

Source

prime-system/examples/android-compose/primes/compiled/@android-compose/rule-color-roles-not-raw-hex/atom.yaml

Compiled at 2026-05-10