What it does
TinyColor is Brian Grinstead’s JavaScript colour library. It accepts loosely formatted colour strings and produces standard colour formats, adjusted variants and related palettes.
The browser demo compares lightness and saturation changes, harmonies and readable alternatives from one input. For an application, install tinycolor2 and create a colour object from a string or channel values.
Chain changes such as lightening and desaturation, then return a hex or RGB string. These operations alter the current object; clone() keeps a separate starting colour.
The readability helpers compare a foreground and background at a chosen AA or AAA level and text size. mostReadable() selects from supplied alternatives and can fall back to black or white when enabled.
The MIT grant allows reuse and modification while requiring the copyright and permission notices.
Strengths
- Permissive parsing suits colour fields where people type values in different forms.
Watch out for
- Chained adjustments change the working colour unless it is cloned first.
Best for
- Web colour inputs and generated theme variants
Sources
- TinyColor developer demo (Oct 27, 2026)
- TinyColor usage reference (Oct 27, 2026)
- TinyColor licence (Oct 27, 2026)
