A color library for CSS colors.
Project description
ColorAide
This is still a work in progress.
Overview
ColorAide is a color library for Python. It was written to handle most modern CSS colors that are available and that will be available. Most of the conversion algorithms come straight from the CSS specifications.
In the process of developing this library, we also stumbled upon colorjs
which is created/maintained by the
co-authors of some of the recent CSS color specifications. This project became heavily influenced by Color.js. While our
aim was not to port that library, it did leave a clear impression on our API. We also leveraged the work related to
gamut mapping and color interpolation.
Currently this project is in an early stage, and while usable, some things may change as we get closer to a stable release.
With ColorAide, you can specify a color, convert it to other color spaces, mix it with other colors, output it in different CSS formats, and various other things.
>>> from coloraide import Color
>>> c = Color("red")
>>> c.to_string()
'rgb(255 0 0)'
>>> c.convert('hsl').to_string()
'hsl(0 100% 50%)'
>>> c.set("lch.chroma", 30).to_string()
'rgb(173.81 114.29 97.218)'
>>> Color("blue").mix("yellow", space="lch").to_string()
'rgb(255 65.751 107.47)'
Documentation
https://facelessuser.github.com/coloraide
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for coloraide-0.1.0a8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7e6e11d36e244c6dfc01d10e4dd63ae9203e44e4b2da81656507cce20d4d8da |
|
MD5 | aad7b8cbabc1d8677a78672dcc37ec17 |
|
BLAKE2b-256 | a3ecafab361795152b8b8338f226f4f500d9c328ebf6d6b2ea5cc949f85269c5 |