SchemeStaticColorBuilder
Implements: |
|
Implementation of
that generates hex color tokens for Material Design static colors (aka. custom colors).
Notes
A static color consists of 4 roles. Suppose the name of the static color is "success", then there will be "success", "on-success", "success-container", and "on-success-container" roles.
A non-empty name must be assigned to this builder. The name assigned to this builder will be used as the prefix to the generated tokens. When the name is "scheme", the generated tokens will be "scheme-success", "scheme-on-success", etc.
When assigned the same name with
, this builder can supplement additional static colors to the main color roles generated by
.
See Also
Properties
Name | Type | Description |
---|---|---|
hctFormatter p |
|
Methods
build()implements
| ||||||
---|---|---|---|---|---|---|
No documentation has been provided. | ||||||
Presentation
| ||||||
Parameters
Returns |
protected getStaticColorTones() | ||||||
---|---|---|---|---|---|---|
No documentation has been provided. | ||||||
Presentation
| ||||||
Parameters
ReturnsRecord<"color" | "onColor" | "colorContainer" | "onColorContainer", number> |
Example usage
provideTheme (
withThemeBuilder ("scheme", SchemeBuilder , {
type: SchemeTonalSpot,
source: Hct.fromInt(0x33bdff),
mode: SchemeMode .Light,
contrast: SchemeContrastLevel .Standard,
}),
withThemeBuilder ("scheme", SchemeStaticColorBuilder , {
name: "success",
source: Hct.fromInt(0x8cb84a),
mode: SchemeMode .Light,
}),
withThemeBuilder ("scheme", SchemeStaticColorBuilder , {
name: "warning",
source: Hct.fromInt(0xd6913e),
mode: SchemeMode .Light,
}),
),