FlexTonalPalette 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 (FlexTonalPalette.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
-
The chroma of the palette.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- hue → double
-
The hue of the palette.
final
- keyColor → Hct
-
The key color of the palette.
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 Methods
-
createKeyColor(
double hue, double chroma) → Hct -
Creates a key color from a
hue
and achroma
. The key color is the first tone, starting from T50, matching the given hue and chroma. Key color Hct. -
fromHct(
Hct hct, [FlexPaletteType paletteType = FlexPaletteType.common]) → FlexTonalPalette -
Create a Tonal Palette from hue and chroma of
hct
. -
fromList(
List< int> colors, [FlexPaletteType paletteType = FlexPaletteType.common]) → FlexTonalPalette - Create colors from a fixed-size list of ARGB color ints.
-
of(
double hue, double chroma, [FlexPaletteType paletteType = FlexPaletteType.common]) → FlexTonalPalette -
Create colors using
hue
andchroma
.
Constants
- commonSize → const int
- Number of tones in commonTones.
-
commonTones
→ const List<
int> - Commonly-used tone values.
- extendedSize → const int
- Number of tones in extendedTones.
-
extendedTones
→ const List<
int> - Extended tone values in a FlexTonalPalette.