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↓53.3%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 today

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

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

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

[nahid/qarray

QArray is a PHP abstraction for querying array

108415.2k2](/packages/nahid-qarray)[helmich/schema2class

Build PHP classes from JSON schema definitions

36147.8k](/packages/helmich-schema2class)[smithfield-studio/acf-svg-icon-picker

Add ACF field for selecting SVG icons.

3912.9k](/packages/smithfield-studio-acf-svg-icon-picker)[luilliarcec/laravel-username-generator

Laravel Username Generator is a package that allows the versatile generation of user names, has a simple integration with Laravel.

1112.1k](/packages/luilliarcec-laravel-username-generator)

PHPackages © 2026

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