ChartColors class
Chart colors derived from a seed color and a real chart background.
All colors live in a visible tone band solved against the background with the library's contrast dial and Algo (APCA by default):
- ramps begin at a border-visible near edge (Usage.border) so they retain enough tone span to encode magnitude;
- categorical fills use a stronger near edge anchored near Usage.large, because every series must remain distinct from the chart background while retaining enough tone span for sibling separation;
- the band's far edge is the tone of maximum separation that the dial requests (Usage.text), forced to the same polarity.
Hue comes from the u'v' harmony system: categorical series spread evenly around the white point from the seed's chromatic direction (the same angles as harmony); diverging ramps use the afterimage complement when the two seeds are too close in direction.
Color vision deficiency is handled structurally rather than by a mode parameter: adjacent categorical series always differ in tone, and tone survives protanopia, deuteranopia, and tritanopia. At high series counts hue gaps shrink and colors become grouping cues rather than identifiers; per the chart brief, labels, boundaries, shapes, and patterns carry identification there.
Constructors
- ChartColors.from(Color seed, {required double backgroundTone, double contrast = 0.5, Algo algo = Algo.apca, ColorModel colorModel = ColorModel.kDefault})
-
Chart colors against a synthesized near-neutral background of
backgroundTone, mirroring Palette.from's background treatment.factory - ChartColors.fromColorAndBackground(Color seed, Color background, {double contrast = 0.5, Algo algo = Algo.apca, ColorModel colorModel = ColorModel.kDefault})
Properties
- algo → Algo
-
final
- background → Color
-
final
- categoricalNearTone → double
-
Closest categorical-fill tone to the background. This is deliberately
stronger than nearTone: ramps need range, while a nominal series must
be visibly foreground even when it lands on the nearest tone tier.
latefinal
- colorModel → ColorModel
-
final
- contrast → double
-
final
- farTone → double
-
Edge of the visible tone band farthest from the background at this
contrast dial (Usage.text), same polarity as nearTone.
latefinal
- hashCode → int
-
The hash code for this object.
no setteroverride
- nearTone → double
-
Edge of the ramp tone band closest to the background: just visibly
distinct from it (Usage.border).
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seed → Color
-
final
- sequential → ToneRamp
-
Ordered low → high ramp at the seed's hue.
latefinal
Methods
-
categorical(
int n, {bool isColorAtIndexStable = true}) → List< Color> -
ndeterministic series colors. -
divergingWith(
Color highSeed) → ToneRamp -
Diverging ramp: this instance's seed on the low side,
highSeedon the high side, neutral at exactly t = 0.5. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override