PHPackages                             phpcolor/phpcolor - 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. phpcolor/phpcolor

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

phpcolor/phpcolor
=================

PHP Color

v1.0.0(2mo ago)12886↑56.3%1MITPHPPHP &gt;=8.3CI passing

Since Mar 16Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/phpcolor/phpcolor)[ Packagist](https://packagist.org/packages/phpcolor/phpcolor)[ Docs](https://phpcolor.dev)[ GitHub Sponsors](https://github.com/sponsors/smnandre)[ RSS](/packages/phpcolor-phpcolor/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

[![Colors](colors.svg)](colors.svg)[![PHPColor logo](https://camo.githubusercontent.com/bf606fc2837879969d637808b39506f6d484359e5a30d3c4c2395f707ea549f1/68747470733a2f2f706870636f6c6f722e6465762f706870636f6c6f722e737667)](https://camo.githubusercontent.com/bf606fc2837879969d637808b39506f6d484359e5a30d3c4c2395f707ea549f1/68747470733a2f2f706870636f6c6f722e6465762f706870636f6c6f722e737667)
==================================================================================================================================================================================================================================================================================================================================================================

[](#)

A PHP library for color: 15 color spaces, perceptual mixing, WCAG contrast,
palette generation, CSS Level 4/5 support, and vision simulation.

 [![PHP Version](https://camo.githubusercontent.com/c266afbd573c64c6f2213cef0adb6fbd9c7f0c6f4bd980c2c05ddecbddeac130/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d6662653863623f6c6162656c436f6c6f723d62663336333626636f6c6f723d666265386362)](https://camo.githubusercontent.com/c266afbd573c64c6f2213cef0adb6fbd9c7f0c6f4bd980c2c05ddecbddeac130/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d6662653863623f6c6162656c436f6c6f723d62663336333626636f6c6f723d666265386362) [![CI](https://camo.githubusercontent.com/67947a3d0918defb040a3429c1fc4f4876a974d3e44f21e2b163f4734b2d88b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870636f6c6f722f706870636f6c6f722f43492e79616d6c3f6272616e63683d6d61696e266c6162656c3d5465737473266c6162656c436f6c6f723d66353965306226636f6c6f723d666566336337)](https://camo.githubusercontent.com/67947a3d0918defb040a3429c1fc4f4876a974d3e44f21e2b163f4734b2d88b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870636f6c6f722f706870636f6c6f722f43492e79616d6c3f6272616e63683d6d61696e266c6162656c3d5465737473266c6162656c436f6c6f723d66353965306226636f6c6f723d666566336337) [![Coverage](https://camo.githubusercontent.com/f968c14a95fe2801f0a0faa2f153840656120976aa6766b15f4fc6f62f0a6037/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850556e69742d3130302532352d3466633038643f6c6162656c436f6c6f723d31306239383126636f6c6f723d643166616535)](https://camo.githubusercontent.com/f968c14a95fe2801f0a0faa2f153840656120976aa6766b15f4fc6f62f0a6037/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850556e69742d3130302532352d3466633038643f6c6162656c436f6c6f723d31306239383126636f6c6f723d643166616535) [![PHPStan](https://camo.githubusercontent.com/90b0c74f19c06af2734262dc60e8dc6db92aab492e327549d88f1dd624b03980/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c766c25323031302d3331633266323f6c6162656c436f6c6f723d30366236643426636f6c6f723d636666616665)](https://camo.githubusercontent.com/90b0c74f19c06af2734262dc60e8dc6db92aab492e327549d88f1dd624b03980/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c766c25323031302d3331633266323f6c6162656c436f6c6f723d30366236643426636f6c6f723d636666616665) [![Release](https://camo.githubusercontent.com/6814a33f91e675327f2ffcadf3dda436676d11a4e6319970966d1e4be6b41bd5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f706870636f6c6f722f706870636f6c6f723f6c6162656c3d537461626c65266c6162656c436f6c6f723d33623832663626636f6c6f723d646265616665)](https://camo.githubusercontent.com/6814a33f91e675327f2ffcadf3dda436676d11a4e6319970966d1e4be6b41bd5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f706870636f6c6f722f706870636f6c6f723f6c6162656c3d537461626c65266c6162656c436f6c6f723d33623832663626636f6c6f723d646265616665) [![License](https://camo.githubusercontent.com/8fb6f191ecd28576b7166c70867c488f90cda36e4a57898f7bbadc725d1b3141/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706870636f6c6f722f706870636f6c6f723f6c6162656c3d4c6963656e7365266c6162656c436f6c6f723d36663439633526636f6c6f723d656465396665)](https://camo.githubusercontent.com/8fb6f191ecd28576b7166c70867c488f90cda36e4a57898f7bbadc725d1b3141/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706870636f6c6f722f706870636f6c6f723f6c6162656c3d4c6963656e7365266c6162656c436f6c6f723d36663439633526636f6c6f723d656465396665)

[![Colors](colors.svg)](colors.svg)

Color Library
-------------

[](#color-library)

- **Modern CSS Support**: Full `CSS Color 4/5` parsing, including `oklch()`, `color-mix()`, and relative color syntax.
- **Perceptual Accuracy**: Uses **Oklab** for mixing and gradients to ensure uniform brightness and hue stability.
- **15 Color Spaces**: Direct conversion between `sRGB`, P3, Lab, XYZ, and more via optimized matrices.
- **Immutable API**: Chainable value objects for colors, palettes, and gradients.
- **Accessibility First**: `WCAG 2.1`/APCA contrast ratios, contrast solver, and 7-profile vision simulation.
- **Developer Friendly**: PHP 8.3+, zero dependencies, typed enums, and PHPStan level 10.

Installation
------------

[](#installation)

```
composer require phpcolor/phpcolor
```

```
use PhpColor\Color\Color;

$color = Color::parse('oklch(65% 0.15 210)');
$lighter = $color->lighten(0.1)->to('display-p3');

echo $lighter->toCss(); // color(display-p3 0.45 0.72 0.88)
```

Create
------

[](#create)

The `Color` class is the main entry point. It accepts strings anywhere a `ColorInterface` is expected, and provides named constructors for every supported color space.

### From CSS strings

[](#from-css-strings)

Any valid CSS color string is accepted, including modern Level 4/5 syntax.

```
use PhpColor\Color\Color;

$color = Color::parse('#3b82f6');
$color = Color::parse('hsl(217 91% 60%)');
$color = Color::parse('oklch(0.65 0.18 264)');
$color = Color::parse('color(display-p3 0.23 0.51 0.96)');
$color = Color::parse('rebeccapurple');
```

`Color::tryFrom()` returns `null` on invalid input instead of throwing.

### From channel values

[](#from-channel-values)

```
$color = Color::rgb(0.23, 0.51, 0.96);
$color = Color::rgb(0.23, 0.51, 0.96, 0.8); // with alpha
$color = Color::oklab(0.62, -0.05, -0.15);
$color = Color::oklch(0.65, 0.18, 264);
$color = Color::hex('#3b82f6');

// Named shortcuts
$black = Color::black();
$white = Color::white();
$red   = Color::red();
```

-&gt; [Parsing docs](docs/getting-started/parsing.md)

Convert
-------

[](#convert)

Every color object converts to any supported color space. Conversions are exact and round-trip safely. The result is always a new typed object that can be further manipulated or [formatted](#format).

```
// Typed conversions
$oklab = $color->toOklab();
$oklch = $color->toOklch();
$srgb  = $color->toSrgb();
$p3    = $color->toDisplayP3();
$lab   = $color->toLab();
$xyz   = $color->toXyz();

// Generic conversion by name
$color->to('oklch');
$color->to('display-p3');
$color->to('rec2020');
```

-&gt; [Color spaces docs](docs/core-concepts/color-spaces.md)

Format
------

[](#format)

Formatting produces a string or structured value from any color object. The output space defaults to the color's current space, but can be overridden.

```
// CSS string (default: native space)
$color->toCss();                // 'oklch(0.65 0.18 264)'
$color->toCss('hsl');           // 'hsl(217 91% 60%)'
$color->toCss('srgb');          // 'rgb(59 130 246)'
$color->toCss('color');         // 'color(srgb 0.231 0.510 0.965)'

// Hex
$color->toHex();                // '#3b82f6'
$color->toHex(withAlpha: true); // '#3b82f6cc'

// String cast (same as toCss())
(string) $color;
$color->toString();

// Raw channel values
$color->getChannels();          // ['r' => 0.23, 'g' => 0.51, 'b' => 0.96]
```

Inspect
-------

[](#inspect)

Color objects expose read methods for common attributes regardless of the underlying space. All values are normalized to a consistent scale.

### Lightness and luminance

[](#lightness-and-luminance)

```
$color->isLight();       // perceived brightness
$color->isDark();
$color->getLuminance();  // relative luminance 0-1, per WCAG
```

### Hue, saturation, opacity

[](#hue-saturation-opacity)

```
$color->getSaturation(); // 0-1
$color->getHue();        // 0-360 degrees
$color->getOpacity();    // 0-1
$color->isOpaque();
$color->isTransparent();
$color->equals($other);  // perceptual equality check
```

### Temperature

[](#temperature)

```
$color->temperature();   // estimated value in Kelvin
$color->isHot();
$color->isCold();
```

-&gt; [Hue docs](docs/reference/hue.md) · [Chroma docs](docs/reference/chroma.md) · [Temperature docs](docs/reference/temperature.md)

Manipulate
----------

[](#manipulate)

All manipulation methods return a new instance. Colors are immutable and chain freely across color spaces.

### Lightness

[](#lightness)

```
$lighter = $color->lighten(0.15);
$darker  = $color->darken(0.15);
$grey    = $color->grayscale();
$inv     = $color->invert();
```

### Saturation and hue

[](#saturation-and-hue)

```
$vivid   = $color->saturate(0.1);
$muted   = $color->desaturate(0.2);
$shifted = $color->rotateHue(30);
```

### Temperature

[](#temperature-1)

```
$warmer = $color->warm(0.1);
$cooler = $color->cool(0.1);
```

### Transparency

[](#transparency)

```
$semiOpaque = $color->withAlpha(0.5);
```

### Blend

[](#blend)

Blends this color against a backdrop using standard CSS compositing modes.

```
$blended = $color->blend('#000000', 'multiply');
$blended = $color->blend($other, 'screen');
// Also: normal, overlay, darken, lighten
```

For perceptual two-color interpolation, see [Mix](#mix).

### Channel control

[](#channel-control)

Direct channel access is useful when you need to set an exact value in a specific color space rather than applying a relative shift.

```
$adjusted = $color->toOklch()->withChannel('l', 0.75);
$adjusted = $color->toOklch()->withChannels(['l' => 0.75, 'c' => 0.12]);

// Chain across spaces
$result = $color->toOklch()->withChannel('h', 120)->to('display-p3')->toCss();
```

-&gt; [Hue docs](docs/reference/hue.md) · [Chroma docs](docs/reference/chroma.md)

Mix
---

[](#mix)

Mixing blends two colors at a given ratio. Oklab is the default interpolation space, which produces perceptually uniform results without the hue shift and brightness dip of sRGB mixing.

```
// 50/50 blend in Oklab (default)
$mixed = Color::mix(Color::red(), Color::blue(), 0.5);

// Control the interpolation space
$mixed = Color::mix('#ff0000', '#0000ff', 0.3, 'oklch');
$mixed = Color::mix($a, $b, 0.5, 'srgb');

// Tint (toward white) and shade (toward black) on a single color
$tinted = $color->tint(0.3);  // 30% white
$shaded = $color->shade(0.3); // 30% black
```

For multi-step interpolation across a full range, see [Palettes](#palettes).

-&gt; [Mixing docs](docs/guides/mixing.md)

Harmonies
---------

[](#harmonies)

These methods generate sets of colors that are harmonically balanced in hue, based on color theory intervals. They operate on any color object and return arrays in the same color space. For detecting or fixing harmony across an existing palette, see [Palettes](#palettes).

```
// Two colors 30 degrees away on either side
[$left, $right] = $color->analogous();
$set = $color->analogous(count: 4);

// Direct opposite on the hue wheel
$opposite = $color->complementary();

// Two colors flanking the complement
[$a, $b] = $color->splitComplementary();

// Three colors evenly spaced (120 degrees apart)
[$a, $b, $c] = $color->triadic();

// Four colors (90 degrees apart)
[$a, $b, $c, $d] = $color->tetradic();
```

-&gt; [Harmony docs](docs/guides/harmony.md)

Palettes
--------

[](#palettes)

A palette is an ordered or named collection of colors. It supports generation, batch transformation, lookup, and CSS export.

### Generate

[](#generate)

```
use PhpColor\Color\Palette\ColorPalette;

// From a base color
$tints  = ColorPalette::tints(Color::parse('#3b82f6'), steps: 9);
$shades = ColorPalette::shades(Color::parse('#3b82f6'), steps: 9);
$scale  = ColorPalette::lightnessScale(Color::parse('#3b82f6'), steps: 11);
$ramp   = ColorPalette::interpolate(Color::red(), Color::blue(), steps: 7);

// From existing colors
$palette = ColorPalette::fromHex(['#ff0000', '#00ff00', '#0000ff']);
$palette = ColorPalette::parse(['red', 'oklch(0.6 0.2 264)', '#3b82f6']);
```

### Transform

[](#transform)

All transformation methods return a new palette. They mirror the single-color [Manipulate](#manipulate) API.

```
$darkened  = $scale->darken(0.1);
$shifted   = $scale->rotateHue(30)->desaturate(0.05);
$p3palette = $scale->to('display-p3');

// Filter and map (map callable must return a ColorInterface)
$light    = $scale->filter(fn($c) => $c->toOklch()->l > 0.5);
$inverted = $scale->map(fn($c) => $c->rotateHue(180));

// Structural: merge(), slice(), reverse(), count()
```

### Lookup

[](#lookup)

```
$closest = $scale->closest(Color::parse('#4f46e5')); // by Oklab distance
$mid     = $scale->at(0.5);                          // interpolated position
```

### Export

[](#export)

Named palettes produce CSS custom properties directly, useful for design token pipelines.

```
$ui = ColorPalette::named([
    'primary'   => Color::parse('#3b82f6'),
    'secondary' => Color::parse('#8b5cf6'),
    'neutral'   => Color::parse('#6b7280'),
]);

echo $ui->toCssVariables('color');
// --color-primary: #3b82f6;
// --color-secondary: #8b5cf6;
// --color-neutral: #6b7280;

// Array export
$hexArray = $scale->toHex();
$cssArray = $scale->toCss('oklch');
```

-&gt; [Palette docs](docs/guides/palette.md)

Gradients
---------

[](#gradients)

The gradient builder uses a fluent API modeled on CSS gradient syntax. Oklab interpolation is the default, avoiding the hue shift and brightness loss of sRGB gradients. For two-color blending, see [Mix](#mix).

```
use PhpColor\Color\Gradient\GradientBuilder;

// Linear gradient
$gradient = GradientBuilder::linear(90)
    ->from('#ff0000')
    ->via('#a855f7')
    ->to('#3b82f6')
    ->in('oklch')
    ->build();

$gradient->toCss(); // 'linear-gradient(90deg, ...)'

// Radial gradient with shape and position
GradientBuilder::radial()
    ->circle()
    ->at('center')
    ->from('white')
    ->to('black')
    ->build();

// Conic gradient with explicit stop positions (0.0-1.0)
GradientBuilder::conic(0)
    ->stop('red', 0.0)
    ->stop('yellow', 0.33)
    ->stop('blue', 0.66)
    ->build();
```

-&gt; [Gradient docs](docs/guides/gradient.md)

Accessibility
-------------

[](#accessibility)

### WCAG contrast

[](#wcag-contrast)

`ColorContrast` calculates contrast ratios per WCAG 2.x. The `WcagLevel` enum prevents invalid inputs and replaces the old string-based API.

```
use PhpColor\Color\Contrast\ColorContrast;
use PhpColor\Color\Contrast\WcagLevel;

$ratio = ColorContrast::calculate(Color::black(), Color::white()); // 21.0

ColorContrast::meetsFor($text, $background, WcagLevel::AA);
ColorContrast::meetsFor($text, $background, WcagLevel::AAA, largeText: true);

ColorContrast::requiredRatio(WcagLevel::AA);  // 4.5 normal, 3.0 large text
ColorContrast::requiredRatio(WcagLevel::AAA); // 7.0 normal, 4.5 large text
```

### APCA

[](#apca)

APCA (Accessible Perceptual Contrast Algorithm) is a newer model that accounts for font weight and size. It returns a signed lightness contrast value rather than a simple ratio.

```
use PhpColor\Color\Contrast\ApcaContrast;

$lc = ApcaContrast::lc($text, $background);
```

### Solving contrast

[](#solving-contrast)

`ContrastSolver` helps fix colors that fail a requirement, rather than just checking them. See also [Vision simulation](#vision) for accessibility testing across color vision profiles.

```
use PhpColor\Color\Contrast\ContrastSolver;

// Adjust lightness until the color passes the target ratio
$fixed = ContrastSolver::adjustLightnessToContrast($text, $background, 4.5);

// Pick the most accessible option from a set of candidates
$best = ContrastSolver::bestOn($background, [$white, $black, $brand]);

// Find the minimum opacity at which a color passes on a given background
$alpha = ContrastSolver::requiredAlpha($text, $background, 4.5);
```

-&gt; [Contrast docs](docs/reference/contrast.md)

Distance
--------

[](#distance)

Color distance measures how different two colors appear to a human observer. PHPColor uses CIEDE2000 by default, the most perceptually accurate formula available. `Color::deltaE()` is a convenient shorthand.

```
// Via the Color facade
$delta = Color::deltaE($a, $b);
$dist  = Color::distance($a, $b, 'CMC');

// Direct, with explicit algorithm choice
use PhpColor\Color\Distance\ColorDistance;

$delta = ColorDistance::deltaE($a, $b);                 // CIEDE2000
$dist  = ColorDistance::calculate($a, $b, 'DeltaE94');
$dist  = ColorDistance::calculate($a, $b, 'CMC');
```

Distance is used internally by `ColorPalette::closest()` and by `ColorVisionSimulator::areDistinguishable()`. See [Vision](#vision).

-&gt; [Distance docs](docs/reference/distance.md)

Vision
------

[](#vision)

`ColorVisionSimulator` applies transformation matrices that approximate how colors appear under a given vision deficiency profile. Useful for testing whether a UI or palette works for colorblind users.

```
use PhpColor\Color\Vision\ColorVisionSimulator;
use PhpColor\Color\Vision\VisionProfile;

$simulator = ColorVisionSimulator::create(VisionProfile::Deuteranomaly);

// Simulate how a single color looks
$simulated = $simulator->simulate($color);

// Check if two colors remain distinguishable under this profile
$ok = $simulator->areDistinguishable($colorA, $colorB); // threshold: 0.06

// Simulate an entire set of colors at once
$simulated = $simulator->simulateAll($palette->all());
```

Supported profiles: `Protanopia`, `Deuteranopia`, `Tritanopia`, `Protanomaly`, `Deuteranomaly` (most common, affecting ~5% of males), `Tritanomaly`, `Monochromacy`.

-&gt; [Vision docs](docs/reference/vision.md)

CSS
---

[](#css)

PHPColor parses and resolves the full CSS Color Level 4/5 expression layer. These features are useful for design token pipelines, server-side theme processing, and any context where colors are expressed as CSS values rather than raw channels.

### color-mix()

[](#color-mix)

Resolves a `color-mix()` expression to a concrete color, using the interpolation space declared in the function.

```
use PhpColor\Color\Css\CssColor;
use PhpColor\Color\Css\CssContext;

$expr     = CssColor::parse('color-mix(in oklab, #ff0000 30%, #0000ff)');
$resolved = $expr->resolve(new CssContext());
```

### light-dark()

[](#light-dark)

Produces a theme-aware color that resolves differently depending on the context's color scheme flag.

```
$adaptive = CssColor::lightDark(
    Color::parse('#1a1a1a'), // light theme value
    Color::parse('#f5f5f5'), // dark theme value
);

$resolved = $adaptive->resolve(new CssContext(scheme: 'dark'));
```

### Custom properties

[](#custom-properties)

Wraps a color with a CSS custom property reference and an optional fallback.

```
$withVar = CssColor::var('--brand-color', Color::parse('#3b82f6'));
```

### Relative color syntax

[](#relative-color-syntax)

Allows deriving a new color from an existing one using CSS channel expressions, following the CSS Color 5 relative color syntax.

```
$relative = CssColor::relative('oklch', $origin, ['l' => 'calc(l + 0.1)'], null);
```

-&gt; [CSS colors docs](docs/reference/css-colors.md) · [Relative colors docs](docs/guides/relative-colors.md)

Color Spaces
------------

[](#color-spaces)

SpaceClassDescriptionsRGB`SrgbColor`Standard RGB (0-1 channels)Oklab`OklabColor`Perceptually uniform, ideal for mixingOklch`OklchColor`Cylindrical Oklab, intuitive hue controlLab`LabColor`CIELAB (D50 illuminant)LCH`LchColor`Cylindrical LabHWB`HwbColor`Hue, Whiteness, Blackness (CSS Color 4)CMYK`CmykColor`Subtractive (print)Display P3`DisplayP3Color`Wide-gamut (Apple displays)Adobe RGB`A98RgbColor`Adobe RGB 1998ProPhoto`ProPhotoColor`Wide-gamut professional photographyRec. 2020`Rec2020Color`HDR and broadcastCIE XYZ`XyzColor`Device-independent reference spaceLinear sRGB`LinearSrgbColor`sRGB without gamma encoding-&gt; [Color spaces docs](docs/core-concepts/color-spaces.md)

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

[](#contributing)

Contributions are welcome. Please open an issue before submitting a pull request for significant changes.

```
git clone https://github.com/phpcolor/phpcolor.git
cd phpcolor
composer install

composer test  # PHPUnit
composer sa    # PHPStan static analysis
composer cs    # PHP-CS-Fixer
```

License
-------

[](#license)

[PHPColor](https://phpcolor.dev) is released under the [MIT license](LICENSE).

[![Colors](colors.svg)](colors.svg)

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance84

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community11

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

Every ~753 days

Total

2

Last Release

86d ago

Major Versions

v0.0.1 → v1.0.02026-04-09

PHP version history (2 changes)v0.0.1PHP &gt;=8.1

v1.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8951d49b371d210280a58ce48969a07d1f49924810f8a1fab3a9343eb46fdc9?d=identicon)[simonandre](/maintainers/simonandre)

![](https://avatars.githubusercontent.com/u/81738559?v=4)[Raphaël Geffroy](/maintainers/raphael-geffroy)[@raphael-geffroy](https://github.com/raphael-geffroy)

---

Top Contributors

[![smnandre](https://avatars.githubusercontent.com/u/1359581?v=4)](https://github.com/smnandre "smnandre (32 commits)")

---

Tags

phpcolor

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpcolor-phpcolor/health.svg)

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21623.4k](/packages/imanghafoori-laravel-anypass)[fjw/color-compare

A library for converting colors (Hex, RGB, HSL, CIELAB (LAB), DIN-99) and calculating color distances based on DIN-99.

1310.8k](/packages/fjw-color-compare)

PHPackages © 2026

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