Part of what makes it cool is that it packs a lot of features in a small footprint – it clocks in at 8.98KB (3.41KB gzipped). Read on for more details.
Color Conversion Features
TinyColor makes is easy to switch to and from the following formats:
- RGB to HSV, RGB to HSL, RGB to Hex, RGB to Named.
- HSV to RGB, HSV to HSL, HSV to Hex, HSV to Named
- HSL to RGB, HSL to HSV, HSL to Hex, HSV to Named
- Hex to RGB, Hex to HSV, Hex to HSL, Hex to Named
- Named to RGB, Named to HSV, Named to HSL, Named to Hex
Note: The color name list was taken from http://www.w3.org/TR/css3-color/#svg-color.
Input strings recognized
TinyColor is exceptionally liberal in the string input it accepts. You can use (or omit) parenthesis or commas; you can use percentages, 0-1 ratios, 0-255.
There is some support for color manipulation
Scheme generation and Color Combinations
There is support for generating color schemes using basic combinations
Is One Color Readable On Another
TinyColor can tell you if one color is readable on another
Sidenote: I tried out the docco project for annotating the source code in this project. The results are here: TinyColor annotated source code. It is pretty awesome how easy it is to get such nice looking output (and it made me be a little more thoughtful about documenting the internal functionality of the framework).