Skip to main content

A color library for CSS colors.

Project description

Donate via PayPal Discord Build Coverage Status License

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

coloraide-0.1.0a12.tar.gz (60.0 kB view details)

Uploaded Source

Built Distribution

coloraide-0.1.0a12-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

Details for the file coloraide-0.1.0a12.tar.gz.

File metadata

  • Download URL: coloraide-0.1.0a12.tar.gz
  • Upload date:
  • Size: 60.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for coloraide-0.1.0a12.tar.gz
Algorithm Hash digest
SHA256 ac9c1a3f30d4b7911f5fab55d75067fb455809f62a58913b4125b89b5338e924
MD5 9d830b631daa6fc572fa9e46bc0c8069
BLAKE2b-256 1aea6fd2a28b8ab606bf1eee2bf59d23fbdbcb91f2932f28e57f49bca4e13e97

See more details on using hashes here.

File details

Details for the file coloraide-0.1.0a12-py3-none-any.whl.

File metadata

  • Download URL: coloraide-0.1.0a12-py3-none-any.whl
  • Upload date:
  • Size: 51.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for coloraide-0.1.0a12-py3-none-any.whl
Algorithm Hash digest
SHA256 742fc89d572ce15091f73d7a38d29cb1696239ef3e68b444eb2baf5a5cb8ac7b
MD5 785ca4a076dc1eca0ddbbeb03026613f
BLAKE2b-256 89c4d464d8459b20418b0d9a57f79e47b892692e223c3cb8d88de495180bc8fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page