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

ActiveLibrary

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 2mo 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 43% 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

3672d 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

[league/csv

CSV data manipulation made easy in PHP

3.5k166.1M646](/packages/league-csv)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[spatie/array-to-xml

Convert an array to xml

1.2k57.8M225](/packages/spatie-array-to-xml)[league/climate

PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.

1.9k14.0M273](/packages/league-climate)[spatie/pdf-to-image

Convert a pdf to an image

1.4k15.2M64](/packages/spatie-pdf-to-image)[league/color-extractor

Extract colors from an image as a human would do.

1.3k4.7M18](/packages/league-color-extractor)

PHPackages © 2026

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