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.
Properties
-
asList
→ List<
int> -
Returns a fixed-size list of ARGB color ints for common tone values.
no setter
- chroma → double
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- hue → double
-
final
- keyColor → Hct
-
final
- 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 at the given
tone
. -
getHct(
double tone) → Hct -
Returns the HCT color at the 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
-
final
Static Methods
-
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.