PHPackages                             baraja-core/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. baraja-core/color

ActiveLibrary

baraja-core/color
=================

Normalize HTML colors.

v1.0.0(4y ago)15PHPPHP ^8.0

Since Sep 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/baraja-core/color)[ Packagist](https://packagist.org/packages/baraja-core/color)[ Docs](https://github.com/baraja-core/color)[ RSS](/packages/baraja-core-color/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

PHP Color normalizer
====================

[](#php-color-normalizer)

Normalize HTML colors.

Idea
----

[](#idea)

On websites, we often need to manipulate the colours we get in different ways. For example, from the user or from another application layer.

This package provides a simple way to normalize the received color to a canonical shape.

When normalizing, you can choose to convert to short or long notation:

Examples:

```
Color::normalize('#aaA'); // '#aaa'
Color::normalize('#abcd'); // '#abc'
Color::normalize('#aaAAaa'); // '#aaa'
Color::normalize('#aaA', Color::FORMAT_LONG); // '#aaaaaa'
```

A second parameter can be used for formatting, which has possible values:

- `Color::FORMAT_SHORT` prefers short notation (if possible)
- `Color::FORMAT_LONG` always returns a long notation

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

1708d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3382204?v=4)[baraja](/maintainers/baraja)[@baraja](https://github.com/baraja)

---

Top Contributors

[![janbarasek](https://avatars.githubusercontent.com/u/4738758?v=4)](https://github.com/janbarasek "janbarasek (7 commits)")

---

Tags

colorcolorshtml-colornormalizerphp-colorvalidator

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/baraja-core-color/health.svg)

```
[![Health](https://phpackages.com/badges/baraja-core-color/health.svg)](https://phpackages.com/packages/baraja-core-color)
```

PHPackages © 2026

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