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

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

fahmiardi/php-color
===================

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

02PHP

Since Jun 28Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)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

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3264535342f6dd2bacce6425cb96c32d6113e25e3adac91a11660be332e764eb?d=identicon)[fahmiardi](/maintainers/fahmiardi)

---

Top Contributors

[![hasbridge](https://avatars.githubusercontent.com/u/647090?v=4)](https://github.com/hasbridge "hasbridge (4 commits)")[![fahmiardi](https://avatars.githubusercontent.com/u/1201482?v=4)](https://github.com/fahmiardi "fahmiardi (1 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/fahmiardi-php-color/health.svg)

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

###  Alternatives

[symfony/polyfill

Symfony polyfills backporting features to lower PHP versions

2.8k4.5M24](/packages/symfony-polyfill)[epartment/nova-dependency-container

A Laravel Nova field container allowing to depend on other fields values

3814.5M13](/packages/epartment-nova-dependency-container)[spatie/laravel-robots-middleware

Add an `all` or `none` robots header to your requests via a middleware in Laravel

3352.1M5](/packages/spatie-laravel-robots-middleware)[kwn/php-rdkafka-stubs

Rdkafka extension stubs for your IDE

1504.0M51](/packages/kwn-php-rdkafka-stubs)[captioning/captioning

A collection of tools to manipulate subtitles

2261.3M7](/packages/captioning-captioning)[misd/linkify

Converts URLs and email addresses in text into HTML links

1122.9M10](/packages/misd-linkify)

PHPackages © 2026

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