TonalPalette class Null safety

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:

  1. of From hue and chroma. (preferred)
  2. 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.

Properties

asList List<int>
Returns a fixed-size list of ARGB color ints for common tone values.
read-only
hashCode int
The hash code for this object.
read-onlyoverride
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

get(int tone) int
Returns the ARGB representation of an HCT color.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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

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 and chroma.

Constants

commonTones → const List<int>
Commonly-used tone values.
[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 99, 100]