Monday, July 20, 2015

Colourettu version 1.1 for Python released


Version 1.1.0 of Colourettu has been released.

Colourettu is a Python library I've written for dealing with colours and "palettes" (groups of 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))
c6 = colourettu.colour([0.242, 0.434, 0.165], normalized_rgb=True)

all_colours = [c1, c2, c3, c4, c5, c6]
p2 = colourettu.palette()
p2.from_list(all_colours)
p2.to_image('p2.png', max_width=360, vertical=False)


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

The changes for this version include a project logo (above), and the addition of the palette class.

Colourettu documentation is now online. A full changelog is online as part of that. The code for Colourettu is hosted on Github.

Saturday, January 17, 2015

Colourettu version 1.0 for Python released

Version 1.0.0 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 (or upgrade) Colourett (assuming you already have Python installed) is to use pip:
pip install colourettu --upgrade

The biggest change with this release is that Colourettu documentation is now online. A full changelog is online as part of that. The code for Colourettu is hosted on Github.

Wednesday, January 14, 2015

MetaLibrary version 9 for OpenTTD released

Version 9 of MetaLibrary has been released.

To recap, MetaLibrary is a collection of code I've written to simplify writing an AI for OpenTTD, a remake of my childhood favorite, Transport Tycoon.

Version 9 brings a couple of bug fixes in the Python build script. The documentation for MetaLibrary has also been updated.

Thursday, December 11, 2014

Colourettu version 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 Colourett (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.

Monday, March 10, 2014

MetaLibrary version 8 for OpenTTD released

Quick on the heals of the release of version 7, version 8 of MetaLibrary has been released.

To recap, MetaLibrary is a collection of code I've written to simplify writing an AI for OpenTTD, a remake of my childhood favorite, Transport Tycoon.

Version 8 brings a 9-30x improvement in the speed of Lakes, and by extension, a speed-up in the Ship Pathfinder. And that's all for now; I figured that would be enough. The documentation for MetaLibrary has also been updated.