PHPackages                             kennwilson/colormap - 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. kennwilson/colormap

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

kennwilson/colormap
===================

Colormap from KennWilson (composer added by hidabe)

01.1k↓42.9%PHP

Since Jun 23Pushed 13y ago1 watchersCompare

[ Source](https://github.com/hidabe/colormap-php)[ Packagist](https://packagist.org/packages/kennwilson/colormap)[ RSS](/packages/kennwilson-colormap/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Colormap (PHP)
==============

[](#colormap-php)

Author: Kenn Wilson

Author URL:

Project URL:

Description
-----------

[](#description)

Colormap provides helper methods to convert colors between different formats used on the web. Supported formats are:

- Six-character hexadecimal (eg, `#000000`)
- Three-character hexadecimal (eg, `#000`)
- RGB (eg, `rgb(0,0,0)`)
- HTML named color, including non-W3C colors (eg, `black`)

Three character hex codes are normalized to six characters and all input is normalized to lowercase. Colors can be converted from any one of these formats to any other.

This library was extracted from [Hextractor](http://www.hextractor.com/).

Usage
-----

[](#usage)

Include class and instantiate a ColorMap object:

```
include_once "colormap.php";
$map = new ColorMap();

```

Call various methods, as needed:

```
$hex  = $map->rgb_to_hex('119 125 66');        // Returns '#777d42'
$rgb  = $map->hex_to_rgb('#777d42', 'string'); // Returns '119 125 66'
$name = $map->hex_to_name('#ffffff');          // Returns 'white'

```

Documentation
-------------

[](#documentation)

Additional information can be found at:

License
-------

[](#license)

This code is released under the terms of the [MIT License](http://www.opensource.org/licenses/mit-license.php) and is free to use and redistribute for any purpose. If you find this code helpful, a link back to [my site](http://www.corvidworks.com/) would be cool, but it’s not required.

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbe5677017d93c02bbecddb899dcf534d761b1ccc2c0a33118725cb54179b26b?d=identicon)[hidabe](/maintainers/hidabe)

---

Top Contributors

[![hidabe](https://avatars.githubusercontent.com/u/50526?v=4)](https://github.com/hidabe "hidabe (1 commits)")

### Embed Badge

![Health badge](/badges/kennwilson-colormap/health.svg)

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

###  Alternatives

[consistence/consistence

Consistence - consistent approach and additions to PHP's functionality

1841.1M18](/packages/consistence-consistence)[h4kuna/ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

50426.5k3](/packages/h4kuna-ares)[umpirsky/transliterator

Transliterator is a PHP library for text transliteration.

63204.2k1](/packages/umpirsky-transliterator)[symfony/polyfill-php71

Symfony polyfill backporting some PHP 7.1+ features to lower PHP versions

26919.8k13](/packages/symfony-polyfill-php71)[tonysm/globalid-laravel

Identify app models with a URI. Inspired by the globalid gem.

45135.1k3](/packages/tonysm-globalid-laravel)[inpsyde/composer-assets-compiler

Composer plugin that installs and compile frontend dependencies for installed Composer packages based on configuration.

25302.4k1](/packages/inpsyde-composer-assets-compiler)

PHPackages © 2026

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