One Logo Pool Ball
wwwwwwwwwwwwwwwwwww

Android Color

Material 3 colors through One.Android.Color

One.Android.Color dynamic Material 3 roles as swatches

One.Android.Color reads Material 3 color roles from the system.

import { One } from 'one'
<View style={{ backgroundColor: One.Android.Color.dynamic.surfaceContainer }}>
<Text style={{ color: One.Android.Color.dynamic.onSurface }}>Hello</Text>
</View>
KeyValue
material.<role>The baseline Material 3 palette, as a #rrggbb string.
dynamic.<role>The same role from the wallpaper colors, as a #rrggbb string.
<name>PlatformColor('@android:color/<name>'), such as system_accent1_500.

material and dynamic take the same roles:

GroupRoles
Primaryprimary, onPrimary, primaryContainer, onPrimaryContainer, primaryInverse, primaryFixed, primaryFixedDim, onPrimaryFixed, onPrimaryFixedVariant
Secondarysecondary, onSecondary, secondaryContainer, onSecondaryContainer, secondaryFixed, secondaryFixedDim, onSecondaryFixed, onSecondaryFixedVariant
Tertiarytertiary, onTertiary, tertiaryContainer, onTertiaryContainer, tertiaryFixed, tertiaryFixedDim, onTertiaryFixed, onTertiaryFixedVariant
Errorerror, onError, errorContainer, onErrorContainer
Outlineoutline, outlineVariant
Surfacebackground, onBackground, surface, onSurface, surfaceVariant, onSurfaceVariant, surfaceInverse, onSurfaceInverse, surfaceBright, surfaceDim, surfaceContainer, surfaceContainerLow, surfaceContainerLowest, surfaceContainerHigh, surfaceContainerHighest

A role reads the light or dark value for the current color scheme at the moment you read it, and an unknown role gives null. Read it during render with useColorScheme() in the component, so a scheme change renders again with the new value. For icons that follow the scheme without a render, use the colorRole prop on One.UI.Icon.

Every key is null on iOS and web.

Edit this page on GitHub.