PHPackages                             mscharley/colourist - 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. mscharley/colourist

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

mscharley/colourist
===================

Colour manipulation library

1.1.2(10y ago)14201[1 issues](https://github.com/mscharley/colourist/issues)[1 PRs](https://github.com/mscharley/colourist/pulls)MITPHPPHP &gt;= 5.6

Since Nov 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mscharley/colourist)[ Packagist](https://packagist.org/packages/mscharley/colourist)[ RSS](/packages/mscharley-colourist/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (13)Used By (0)

colourist
=========

[](#colourist)

[![Circle CI](https://camo.githubusercontent.com/2afd072e3a6eabd4547276eaead17bc3502f1ab3024211ebabbb39eff04eaeb0/68747470733a2f2f636972636c6563692e636f6d2f67682f6d73636861726c65792f636f6c6f75726973742f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/mscharley/colourist/tree/master)[![Code Climate](https://camo.githubusercontent.com/c0bb33b657e3075780fa3486080c27cb5a5fd340506f98c1155d63607d2e16d4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d73636861726c65792f636f6c6f75726973742f6261646765732f6770612e737667)](https://codeclimate.com/github/mscharley/colourist)

[![Latest Stable Version](https://camo.githubusercontent.com/8bd351486270f53adbd1743939e8601c58d7b6b8b60a1fe83846f6384ea3eeef/68747470733a2f2f706f7365722e707567782e6f72672f6d73636861726c65792f636f6c6f75726973742f762f737461626c65)](https://packagist.org/packages/mscharley/colourist)[![Total Downloads](https://camo.githubusercontent.com/90901073ae2625d0a7b97707e879312e4d20a8343b30dab1a291522be703bd97/68747470733a2f2f706f7365722e707567782e6f72672f6d73636861726c65792f636f6c6f75726973742f646f776e6c6f616473)](https://packagist.org/packages/mscharley/colourist)

**Source:**
**Author:** Matthew Scharley
**Contributors:** [See contributors on GitHub](https://github.com/mscharley/colourist/graphs/contributors)
**Bugs/Support:** [Github Issues](https://github.com/mscharley/colourist/issues)
**Copyright:** 2015
**License:** [MIT license](https://github.com/mscharley/colourist/blob/master/LICENSE)
**Status:** Active

Synopsis
--------

[](#synopsis)

`colourist` is a small library for PHP 5.6+ that helps ease working with colours and colour transformations.

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

[](#installation)

```
$ composer require mscharley/colourist

```

Usage
-----

[](#usage)

```
$colour = \Colourist\Colour::fromHex('#ffccaa');

// Automatically conversions to calculate values you need.
$h = $colour->hue();
$l = $colour->lightness();
$b = $colour->brightness();

// Distinguish between different types of saturation.
$sl = $colour->hslSaturation();
$sb = $colour->hsbSaturation();

// Explicit conversions if you need them.
$hsl = $colour->toHSL();
$sl == $hsl->saturation();
// Colours are immutable - conversions are highly cached as a result.

// Freely convert between colour spaces as required.
$hsb = $colour->toHSB();
$colour->equals($hsb->toRGB()); // TRUE
```

Gotchas
-------

[](#gotchas)

```
$colour = \Colourist\Colour::fromHex('#ffccaa');
$colour2 = \Colourist\Colour::fromHex('#aaccff');

// You must use ->equals() for comparing equality.
$colour->equals($colour2); // FALSE
$colour == $colour2; // stack overflow
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 96.7% 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 ~17 days

Recently: every ~38 days

Total

10

Last Release

3739d ago

PHP version history (2 changes)1.0.0PHP &gt;= 5.5

1.1.0PHP &gt;= 5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d4787bdf5d418b6bf5df3af8b5d6348af85983750ffda13fe2269d4cbbc8aad?d=identicon)[mscharley](/maintainers/mscharley)

---

Top Contributors

[![mscharley](https://avatars.githubusercontent.com/u/336509?v=4)](https://github.com/mscharley "mscharley (145 commits)")[![slawira](https://avatars.githubusercontent.com/u/2723266?v=4)](https://github.com/slawira "slawira (5 commits)")

---

Tags

colorcolor-manipulationcolorscolourcolour-manipulationcolourscomposercomposer-packagesphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mscharley-colourist/health.svg)

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

PHPackages © 2026

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