v0.1.0-next
v0.1.0-next
v0.1.0 — prerelease
Unreleased
This version is a draft tracked on main and not yet tagged. The API is expected to change before the release.
The first draft of the color and theming library: an HSL color model, the common manipulation primitives and a set of color schemes.
Added
Colors
Color— an HSL color built onDegreeandFraction, which wrap and clamp their values on construction.ColorLike— a union ofColor,Int(hex) andArray(RGB or HSL), withfromto normalize any of them into aColor.- Constructors
hsl,rgbandhex, plus the constantswhiteandblack. - Manipulation functions
complement,tint,shade,toneandmix. Theme— five schemes (accent, highlight, surface, border, text) paired with four status colors (warning, error, info, success).retroDark— a built-in dark theme with neon accents.
See Colors for the full reference.
Schemes
Scheme— the attribute behind every color scheme, mapping an index to a color, andSchemeLikewithschemeFromto normalize colors and arrays into schemes.CustomSchemeandConstantSchemefor user-supplied generators and fixed, wrapping color lists.- Color wheel schemes
Complementary,Analogous,Triadic,Tetradic,GoldenSpiralandRainbow. - Single base schemes
Monochromatic,Shade,Tint,ToneandMix. prependto put a fixed color in front of an existing scheme.
See Schemes for the full reference.
Maths
Degree— a numeric wrapper that wraps values around at360.Fraction— a numeric wrapper that clamps values to0.0 … 1.0.
See Maths for the full reference.
Known issues
hexis unimplemented and panics. Everything derived from it —white,blackandretroDark— panics as well; usergborhslin the meantime.- Scheme fields are declared as
Color2, a type that does not exist incolors. tonedeclares aTonereturn type but returns aColor.