API reference

ColorScheme Class

Semantic colors from which every default component treatment is derived.
Copy a role for focused theme changes. Keep each ColorRole.container paired with content colors that satisfy contrast requirements.

Signature

@Immutable
data class ColorScheme(
    val background: ColorRole,
    val surface: ColorRole,
    val surfaceVariant: ColorRole,
    val accent: ColorRole,
    val accentMuted: ColorRole,
    val selected: ColorRole,
    val onMedia: ColorRole,
    val positive: StatusColors,
    val negative: StatusColors,
    val warning: StatusColors,
    val notification: StatusColors,
    val outline: Color,
    val divider: Color,
    val disabledContent: Color,
    val disabledContainer: Color,
    val link: Color,
    val interactions: InteractionColors,
    val progress: ProgressColors,
)

Constructors

ColorScheme ( background , surface , surfaceVariant , accent , accentMuted , selected , onMedia , positive , negative , warning , notification , outline , divider , disabledContent , disabledContainer , link , interactions , progress )
Signature
constructor(
    background: ColorRole,
    surface: ColorRole,
    surfaceVariant: ColorRole,
    accent: ColorRole,
    accentMuted: ColorRole,
    selected: ColorRole,
    onMedia: ColorRole,
    positive: StatusColors,
    negative: StatusColors,
    warning: StatusColors,
    notification: StatusColors,
    outline: Color,
    divider: Color,
    disabledContent: Color,
    disabledContainer: Color,
    link: Color,
    interactions: InteractionColors,
    progress: ProgressColors,
)
Parameters
background: ColorRole  app or window background
surface: ColorRole  primary grouped-content surface
surfaceVariant: ColorRole  supporting or recessed surface
accent: ColorRole  highest-emphasis action role
accentMuted: ColorRole  medium-emphasis action role
selected: ColorRole  selected item role
onMedia: ColorRole  content and controls placed over media
positive: StatusColors  success or valid status
negative: StatusColors  error, danger, or destructive status
warning: StatusColors  caution status
notification: StatusColors  informational or notification status
outline: Color  visible boundaries on neutral surfaces
divider: Color  separators between adjacent content
disabledContent: Color  disabled text and icons
disabledContainer: Color  disabled filled controls
link: Color  interactive text and focus emphasis
interactions: InteractionColors  hover, press, and scrim colors
progress: ProgressColors  progress track and indicator colors
Returns
ColorScheme

Properties

accent : ColorRole
[Get]
highest-emphasis action role
Signature
val accent: ColorRole
accentMuted : ColorRole
[Get]
medium-emphasis action role
Signature
val accentMuted: ColorRole
background : ColorRole
[Get]
app or window background
Signature
val background: ColorRole
disabledContainer : Color
[Get]
disabled filled controls
Signature
val disabledContainer: Color
disabledContent : Color
[Get]
disabled text and icons
Signature
val disabledContent: Color
divider : Color
[Get]
separators between adjacent content
Signature
val divider: Color
interactions : InteractionColors
[Get]
hover, press, and scrim colors
Signature
val interactions: InteractionColors
link : Color
[Get]
interactive text and focus emphasis
Signature
val link: Color
negative : StatusColors
[Get]
error, danger, or destructive status
Signature
val negative: StatusColors
notification : StatusColors
[Get]
informational or notification status
Signature
val notification: StatusColors
onMedia : ColorRole
[Get]
content and controls placed over media
Signature
val onMedia: ColorRole
outline : Color
[Get]
visible boundaries on neutral surfaces
Signature
val outline: Color
positive : StatusColors
[Get]
success or valid status
Signature
val positive: StatusColors
progress : ProgressColors
[Get]
progress track and indicator colors
Signature
val progress: ProgressColors
selected : ColorRole
[Get]
selected item role
Signature
val selected: ColorRole
surface : ColorRole
[Get]
primary grouped-content surface
Signature
val surface: ColorRole
surfaceVariant : ColorRole
[Get]
supporting or recessed surface
Signature
val surfaceVariant: ColorRole
warning : StatusColors
[Get]
caution status
Signature
val warning: StatusColors

Extension Functions

withAccent ( containerColor , content )
Copies this scheme with one custom accent applied to accent and selected semantics.
Signature
fun ColorScheme.withAccent(
    containerColor: Color,
    content: ContentColors = ContentColors(contentColorFor(containerColor)),
): ColorScheme
Extension declared in metavrx.uiset.compose.theme
Parameters
containerColor: Color  opaque accent background
content: ContentColors  complete foreground hierarchy paired with containerColor
Returns
ColorScheme