PHPackages                             brio/named-colors - 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. brio/named-colors

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

brio/named-colors
=================

Find a color's hexadecimal value from its name

1.0.0(9y ago)0261MITPHPPHP &gt;=5.3.0

Since Mar 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/MarcBrillault/namedColors)[ Packagist](https://packagist.org/packages/brio/named-colors)[ RSS](/packages/brio-named-colors/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (3)Used By (0)

NamedColors
===========

[](#namedcolors)

Find a color's hexadecimal value from its name.

This library does not only list all the HTML colors, but also :

- Australian Independent Colour Standard (AS 2700)
- Some major brands color (*Google*, *Netflix*, *Facebook*, etc)
- [Federal Standard 595](https://en.wikipedia.org/wiki/Federal_Standard_595) colors
- [ISCC–NBS system](https://en.wikipedia.org/wiki/ISCC%E2%80%93NBS_system) colors
- [Natural Color System](https://en.wikipedia.org/wiki/Natural_Color_System) colors
- [RAL colour standard](https://en.wikipedia.org/wiki/RAL_colour_standard) colors
- [Resene](http://www.resene.co.nz/) colors
- [X11 colors](https://en.wikipedia.org/wiki/X11_color_names)
- and some other colors (Crayola colors, food colors, and even [XKCD's colors from its 2010 survey](https://blog.xkcd.com/2010/05/03/color-survey-results/))

Installation
============

[](#installation)

With composer :

```
composer require brio/named-colors

```

Usage
=====

[](#usage)

```
use Brio\NamedColors;

// Find a color from its name or reference
// Note that, if multiple matches are possible, the first match is returned
// html colors are always first to be matched
$color = NamedColors::findHexByName('red'); // returns #FF0000
$color = NamedColors::findHexByName('Google Red'); // returns #EA4335

// Find a color from its name, with a specific color set
$color = NamedColors::findHexByName('red', 'xkcd'); // returns #E50000
```

Contributing
============

[](#contributing)

Feel free to add your own color schemes, as soon as they meet these requirements :

- All colors schemes should be created in the `src/colors` directory
- They must only contain one array, named `$colors`
- Each item of this array must have one key, and these three values :
    - reference
    - name
    - hexa
- The key should be a camelCase version of the color's name
- `reference` and `name` are not mandatory
- The `hexa` key is mandatory, it should contain the hexadecimal value of the color, prefixed with a sharp (`#`).

Credit
======

[](#credit)

The first release's colors all come from the [W3Schools](https://www.w3schools.com/colors/colors_names.asp) website, thanks to them !

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

3398d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66ebada9ef733ae4cde52a5a5ea84736532e398edb699b94dfa8bdfaa5392511?d=identicon)[captain\_torche](/maintainers/captain_torche)

---

Top Contributors

[![MarcBrillault](https://avatars.githubusercontent.com/u/2051814?v=4)](https://github.com/MarcBrillault "MarcBrillault (30 commits)")

---

Tags

colorcolor-pickercolor-schemehexadecimal

### Embed Badge

![Health badge](/badges/brio-named-colors/health.svg)

```
[![Health](https://phpackages.com/badges/brio-named-colors/health.svg)](https://phpackages.com/packages/brio-named-colors)
```

PHPackages © 2026

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