PHPackages                             kimitri/coltrane - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kimitri/coltrane

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kimitri/coltrane
================

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.

1.2.1(2y ago)016MITPHP

Since Jan 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Kimitri/coltrane)[ Packagist](https://packagist.org/packages/kimitri/coltrane)[ Docs](https://coltrane.abstractequipment.com)[ RSS](/packages/kimitri-coltrane/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (10)Used By (0)

Coltrane - A command line utility for CSS color transformations
===============================================================

[](#coltrane---a-command-line-utility-for-css-color-transformations)

Coltrane is a command line utility to transform CSS (and SVG) colors between different representations. It supports transformations between Display-P3 (with and without alpha), hex, hsl, hsla, rgb and rgba. Currently, it's one of the few tools that support the wide gamut Display-P3 colors.

Installation
------------

[](#installation)

Coltrane is written in PHP and can be installed using Composer: `composer global require kimitri/coltrane`

After this the `coltrane` executable is installed in the Composer binary directory (typically `~/.composer/vendor/bin`). Make sure that directory is included in your `$PATH`.

Usage
-----

[](#usage)

Coltrane is designed to be integrated into various automated workflows and therefore works great in a wide variety of use cases. By default Coltrane reads its input from `stdin` and outputs to `stdout` but you can use plain old files by specifying the `--infile` and `--outfile` (`-i` and `-o`) options.

### Palette alignment

[](#palette-alignment)

Coltrane also provides a handy palette alignment function and a bunch of built-in palettes. Palette is specified using the `--palette` (`-p`) option and palettes are simple text files consisting of regular hex colors (one color per line) without the preceding # character. This format is supported by the [Lospec website](https://lospec.com/palette-list) (`.HEX` files). To use a custom palette, just give the `--palette` option the path to your palette file.

Coltrane comes with a bunch of retro themed palettes from the [Lospec website](https://lospec.com/palette-list). These built-in palettes can be listed by running `coltrane palettes`. To use a built-in palette, just give the `--palette` option the name of the built-in palette.

### Alpha channel

[](#alpha-channel)

Some color formats (in Coltrane's case these are display-p3a, hsla and rgba) support alpha channels and Coltrane provides a few ways to specify target alpha values. Alpha values range from 0 (fully transparent) to 1 (fully opaque). Alpha can be set using the `--alpha` (`-a`) option and there are two different modes of operation:

- Use a static alpha value (e.g. `--alpha .8` to use alpha value of 0.80).
- Map alpha to the R, G, B or alpha channel of the input color (e.g. `--alpha r` to use the relative red channel value as alpha). Please note that R, G and B channels are also used with hsla colors. (Alpha channel handling was changed in version 1.2.0 and the original alpha is now preserved by default.)

### Usage examples

[](#usage-examples)

1. Read a CSS file with colors defined as hexadecimal values and output the same CSS with colors transformed into wide gamut Display-P3: `coltrane hex2display-p3 -i source.css -o wide-gamut.css`
2. Take a CSS string from the macOS clipboard, transform all colors defined as `rgb()` into wide gamut Display-P3 and store the resulting CSS back to clipboard: `pbpaste | coltrane rgb2display-p3 | pbcopy`
3. Take a CSS string from the macOS clipboard, transform all colors defined as hexadecimal values into `rgba()` using the original alpha value of the input color, align them to the classic CGA palette and write the resulting CSS into a file: `pbpaste | coltrane hex2rgba -a a -p cga1-hi -o cga-is-still-cool.css`

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~83 days

Recently: every ~138 days

Total

9

Last Release

958d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/445639?v=4)[Kimmo Tapala](/maintainers/Kimitri)[@Kimitri](https://github.com/Kimitri)

---

Top Contributors

[![Kimitri](https://avatars.githubusercontent.com/u/445639?v=4)](https://github.com/Kimitri "Kimitri (17 commits)")

### Embed Badge

![Health badge](/badges/kimitri-coltrane/health.svg)

```
[![Health](https://phpackages.com/badges/kimitri-coltrane/health.svg)](https://phpackages.com/packages/kimitri-coltrane)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k52](/packages/friendsoftypo3-content-blocks)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5186.0k18](/packages/phel-lang-phel-lang)[dagger/dagger

Dagger PHP SDK

261.1k](/packages/dagger-dagger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
