PHPackages                             alexsasharegan/php-color - 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. alexsasharegan/php-color

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

alexsasharegan/php-color
========================

Color utility class for PHP 5.3 that allows for easy conversion between RGB, HSV, XYZ, and Lab color spaces, as well as color comparison

v1.0.1(9y ago)013MITPHPPHP ~5.3

Since Dec 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/alexsasharegan/php-color)[ Packagist](https://packagist.org/packages/alexsasharegan/php-color)[ RSS](/packages/alexsasharegan-php-color/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PHP Color Utility Class
=======================

[](#php-color-utility-class)

This class is intended to make it easier to convert between colorspaces, as well as compare one color to another.

Requirements
------------

[](#requirements)

- PHP 5.3 or greater (closure support is required)

Examples:
---------

[](#examples)

### Initialize object (using hex notation is easier if you are familiar with CSS colors):

[](#initialize-object-using-hex-notation-is-easier-if-you-are-familiar-with-css-colors)

```
$color = new Color(0xFFFFFF);

```

### Get distance from another color using the RGB colorspace:

[](#get-distance-from-another-color-using-the-rgb-colorspace)

```
$color1 = new Color(0xFFFFFF);
$color2 = new Color(0x888888);

$distance = $color1->getDistanceRgbFrom($color2);

```

### Get closest matching color using the Lab(CIE) colorspace:

[](#get-closest-matching-color-using-the-labcie-colorspace)

```
$color = new Color(0xFFFFFF);

$palette = array(
    0x000000,
    0x888888,
    0xAAAAAA
);

$matchIndex = $color->getClosestMatch($palette);
$matchColor = $palette[$matchIndex];

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.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 ~0 days

Total

2

Last Release

3496d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16269252?v=4)[Alex Regan](/maintainers/alexsasharegan)[@alexsasharegan](https://github.com/alexsasharegan)

---

Top Contributors

[![hasbridge](https://avatars.githubusercontent.com/u/647090?v=4)](https://github.com/hasbridge "hasbridge (4 commits)")[![jedateach](https://avatars.githubusercontent.com/u/1356335?v=4)](https://github.com/jedateach "jedateach (1 commits)")[![Josiah](https://avatars.githubusercontent.com/u/77621?v=4)](https://github.com/Josiah "Josiah (1 commits)")

### Embed Badge

![Health badge](/badges/alexsasharegan-php-color/health.svg)

```
[![Health](https://phpackages.com/badges/alexsasharegan-php-color/health.svg)](https://phpackages.com/packages/alexsasharegan-php-color)
```

###  Alternatives

[flowpack/nodegenerator

Random nodes generator for Neos CMS

122.1k](/packages/flowpack-nodegenerator)[haariga/craft-gonzo

Component Library from your templates Folder

121.7k](/packages/haariga-craft-gonzo)

PHPackages © 2026

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