Coltrane is a command line utility to transform CSS (and SVG) colors between different representations. It supports transformations between Display-P3, hex, hsl, hsla, rgb and rgba. Currently, it's one of the few tools that support the wide gamut Display-P3 colors.
Currently, using Display-P3 on the web is not easy: it's only supported by Apple's Safari on selected hardware and it also has it's own way of representing color making it kind of difficult to implement support for it. But when you have all the pieces together - OMG, it looks sooooo good!
Making it easy for web developers to convert existing CSS colors to Display-P3 is the first step in making the web more vibrant. Also, why don't we make it easy to convert between all the different color representations while we're at it? And when we're already dealing with colors, why not throw in a way to align colors to a predefined palette? This is why I created Coltrane - it does it all.
I also wanted to make Coltrane flexible. I want to script it. I want to throw it in an automated workflow and do all my color conversions and palette alignments automatically when I save my styles. Coltrane supports all this by playing along nicely with other command line utilities using pipes. Of course, you can use plain old files, too.
How do I get Coltrane?
Coltrane is written in PHP and you can install it easily from Packagist using Composer:
composer global require kimitri/coltrane
The project is hosted on GitHub. The beautiful vector image above was downloaded from Vecteezy.