PHPackages                             alistairshaw/name-the-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. alistairshaw/name-the-color

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

alistairshaw/name-the-color
===========================

Provide color names from hex values and hex values for color names

0.1.1(10y ago)31.9k2[1 issues](https://github.com/alistairshaw/name-the-color/issues)MITPHPPHP &gt;=5.4.0

Since Apr 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/alistairshaw/name-the-color)[ Packagist](https://packagist.org/packages/alistairshaw/name-the-color)[ Docs](https://github.com/alistairshaw/name-the-color)[ RSS](/packages/alistairshaw-name-the-color/feed)WikiDiscussions develop Synced 4w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Install
-------

[](#install)

Via Composer

```
$ composer require alistairshaw/name-the-color:0.1.*
```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

use AlistairShaw\NameTheColor\ColorMaker;

// You can get a Color object from a hex code. It will find the closest named color to your hex.
$color = ColorMaker::fromHex('#FF0000');

// or from the name of the color
$color = ColorMaker::fromString('Red');

// once you have the color object you can get the resulting color like so:
echo $color->getName() . ' - ' . $color->getHex() . ' (' . $color->getOriginalHex() . ')';
```

Contributing
------------

[](#contributing)

Contributions are very welcome and will be fully credited, just please make sure to add tests.

Credits
-------

[](#credits)

- [Alistair Shaw](https://github.com/alistairshaw)
- [All Contributors](https://github.com/alistairshaw/name-the-color/contributors)

Lots of credit to Chirag Mehta who came up with this in Javascript back in 2007. (). The list of colors comes from his website as well as the method for converting hex codes.

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~17 days

Total

2

Last Release

3720d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73f9bfd4563c8c2fc004079fd5a3141ac7be60b247f64d05a36b1fffe975697a?d=identicon)[alistairshaw](/maintainers/alistairshaw)

---

Top Contributors

[![alistairshaw](https://avatars.githubusercontent.com/u/2110205?v=4)](https://github.com/alistairshaw "alistairshaw (11 commits)")

---

Tags

convertcolorspalettecolor names

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alistairshaw-name-the-color/health.svg)

```
[![Health](https://phpackages.com/badges/alistairshaw-name-the-color/health.svg)](https://phpackages.com/packages/alistairshaw-name-the-color)
```

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7855.7M46](/packages/akaunting-laravel-money)[iamcal/php-emoji

This is a PHP library for dealing with Emoji, allowing you to convert between various native formats and displaying them using HTML.

1.3k528.3k](/packages/iamcal-php-emoji)[gabrielelana/byte-units

Library to parse, format and convert byte units

1682.3M20](/packages/gabrielelana-byte-units)[khill/php-duration

Converts between colon formatted time, human-readable time and seconds

1571.8M20](/packages/khill-php-duration)[misd/linkify

Converts URLs and email addresses in text into HTML links

1123.1M11](/packages/misd-linkify)[tomloprod/colority

Colority is a lightweight PHP library designed to handle color transformations, validations and manipulations with ease.

237125.3k2](/packages/tomloprod-colority)

PHPackages © 2026

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