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:
- complement: +180 degrees (afterimageComplement)
- harmony: n evenly spaced directions; the set can mix to gray
- analogous: small steps to either side
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> -
countcolors:xflanked by neighborsstepdegrees apart in chromatic direction (u'v' angle around the white point). For oddcount, x is the middle element. -
harmony(
Hct x, int n, {bool balanced = false, HarmonyTonePolicy tonePolicy = HarmonyTonePolicy.preserveTone}) → List< Hct> -
ncolors whose chromatic directions are evenly spaced around the white point, starting atx. 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
tonewhose chromaticity sitsuvChromafrom the white point in directionuvHue(degrees), clamped to the sRGB gamut.