effects/uv_harmony library

Color harmony as vector arithmetic around the white point.

A color is gray plus a chromatic push: in CIE 1976 u'v' (where light mixing is linear) the push is a vector from the white point with a direction (HctUvCoordinates.uvHue) and a magnitude (HctUvCoordinates.uvChroma). Harmony operations are arithmetic on the direction:

Direction is the harmony definition. Tone is a rendering policy; see HarmonyTonePolicy. Note that HCT chroma is not comparable across hues (equal chromatic strength can cost C23 in blue and C30 in teal); uvChroma is the comparable measure.

Enums

HarmonyTonePolicy
How harmony colors choose their rendered tone after their u'v' direction has been chosen.

Extensions

HctUvCoordinates on Hct
u'v' polar coordinates of a color's chromatic push from the white point.

Functions

analogous(Hct x, {int count = 5, double step = 30.0, HarmonyTonePolicy tonePolicy = HarmonyTonePolicy.preserveTone}) → List<Hct>
count colors: x flanked by neighbors step degrees apart in chromatic direction (u'v' angle around the white point). For odd count, x is the middle element.
harmony(Hct x, int n, {bool balanced = false, HarmonyTonePolicy tonePolicy = HarmonyTonePolicy.preserveTone}) → List<Hct>
n colors whose chromatic directions are evenly spaced around the white point, starting at x. Because the directions cancel, an additive mixture of the set (at some ratio) is neutral gray: this is the checkable property behind complement (n=2), triad (n=3), and quad (n=4).
hctFromUv(double tone, double uvHue, double uvChroma, {ColorModel model = ColorModel.kDefault}) → Hct
Color at tone whose chromaticity sits uvChroma from the white point in direction uvHue (degrees), clamped to the sRGB gamut.