Expand description
Material dynamic color: HCT, tonal palettes and seed-generated schemes.
A port of Google’s material-color-utilities at commit
bd811e4ca2ab94c4ce3cadc89c19b1820b9704b3, licensed under Apache-2.0
(licenses/material-color-utilities.txt). Each file keeps its notice and
states that it was modified.
Not ported: the image quantizers and score (schemes start from a known
seed), the watch platform and the CMF variant, the deprecated CorePalette
and Scheme classes, and multiple source colors.
Modules§
- blend
- Blending in HCT and CAM16.
- contrast
- Contrast ratios between tones, and tones that reach a given ratio.
- utils
- Math and color-space conversions shared by the dynamic color port.
Structs§
- Cam16
- A color in CAM16, the appearance model behind HCT’s hue and chroma.
- Contrast
Curve - A value that changes with the contrast level, usually the contrast a color needs against its background.
- Dynamic
Scheme - The state a
DynamicRoleresolves against. - Hct
- Hue, chroma and tone: CAM16 hue and chroma with L* as tone, so a tone difference predicts contrast (40 gives at least 3:1, 50 at least 4.5:1).
- Seed
Scheme - What a generated theme is made from.
- Temperature
Cache - The input color with its hue circle, sorted by temperature, computed once.
- Tonal
Palette - A hue and chroma, from which any tone can be requested.
- Viewing
Conditions - The environment a color is seen in, with the CAM16 intermediates that depend only on it. Field names are CAM16’s own terms.
Enums§
- Dynamic
Role - A role of a
DynamicScheme. - Spec
Version - The version of Material’s color spec.
- Variant
- The style of a generated scheme.
Functions§
- fix_
if_ disliked - A disliked color lightened to tone 70; any other color unchanged.
- is_
disliked - Whether a color is a non-neutral dark yellow-green.
- raw_
temperature - The cool-warm factor of a color (Ou, Woodcock and Wright, in Lab*): below 0 is cool, above 0 warm.