Colourettu

Colourettu 0.1.1 for Python released

Version 0.1.1 of Colourettu has been released.

Colourettu is a Python library I’ve written for dealing with colours, and specifically to determine the contrast between two colours.

A quick example:

import colourettu
c1 = colourettu.colour()                # defaults to #FFF
c2 = colourettu.colour("#eee")          # equivalent to #EEEEEE
c3 = colourettu.colour("#456bda")
c4 = colourettu.colour([3, 56, 129])    # as an RGB tuple or list
c5 = colourettu.colour((63, 199, 233))
>>> colourettu.contrast("#FFF", "#FFF") # white on white
1.0
>>> colourettu.contrast(c1, "#000")     # black on white
20.999999999999996
>>> colourettu.contrast(c4, c5)
4.363552233203198

The easiest to install Colourettu (assuming you already have Python installed) is to use pip:

pip install colourettu

This is the first release of this library. The code for Colourettu is hosted on Github.


Other posts


Other posts under Colourettu



Comments

There are no comments yet. Will you add the first one?

Add a Comment

You can use the Markdown syntax to format your comment.

or alternately, send me your thoughts at minchinweb [at] gmail.com

Comment Atom Feed (for this post)