TonalPalette class
A convenience class for retrieving colors that are constant in hue and chroma, but vary in tone.
This class can be instantiated in two ways:
- of From hue and chroma. (preferred)
- fromList From a fixed-size (TonalPalette.commonSize) list of ints representing ARBG colors. Correctness (constant hue and chroma) of the input is not enforced. get will only return the input colors, corresponding to commonTones. This also initializes the key color to black.
- Annotations
Properties
-
asList
→ List<
int> -
Returns a fixed-size list of ARGB color ints for common tone values.
no setter
- chroma → double
-
Get the chroma value for this TonalPalette.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hue → double
-
Get the Hue value for this TonalPalette.
no setter
- keyColor → Hct
-
Get the keyColor used to make this TonalPalette.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
get(
int tone) → int - Returns the ARGB representation of an HCT color.
-
getHct(
double tone) → Hct - Get the HCT color for a given tone.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
- commonSize → int
-
Amount of tone in standard Material3 tonal palette.
final
Static Methods
-
createKeyColor(
double hue, double chroma) → Hct - Key color Hct.
-
fromHct(
Hct hct) → TonalPalette -
Create a Tonal Palette from hue and chroma of
hct
. -
fromList(
List< int> colors) → TonalPalette - Create colors from a fixed-size list of ARGB color ints.
-
of(
double hue, double chroma) → TonalPalette -
Create colors using
hue
andchroma
.
Constants
-
commonTones
→ const List<
int> - Commonly-used tone values.