PHPackages                             s4urp8n/css-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. s4urp8n/css-color

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

s4urp8n/css-color
=================

02PHP

Since Jun 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/s4urp8n/css-color)[ Packagist](https://packagist.org/packages/s4urp8n/css-color)[ RSS](/packages/s4urp8n-css-color/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

css-color
=========

[](#css-color)

CSS color parser and convertor

### Constructors

[](#constructors)

```
$color = Color::hex('#ff00f0');
$color = Color::rgb(250, 00, 20);
$color = Color::rgb(250, 00, 20, 0.3);

```

### Parsing colors from strings

[](#parsing-colors-from-strings)

```
$colorsToParse = [
    'ffffff80',
    'CORNFLOWERBLUE',
    'rgba(255,255,255,0.5)',
    'rgba(255,255,255,0.55);',
    'rgba(255,255,255,1)',
    'rgba(255,255,255,0)',
    'rgba(255,255,255,1)',
    'rgb(   255,255,255)',
    'rgb(  0, 191, 255)',
    'ffffff',
    '   #ffffff    ',
    'CORNSILK',
    'CRIMSON',
    '  CYAN',
];

foreach ($colorsToParse as $value) {
    $color = Color::parse($value);
    printf("initial: '%s', rgb: %s, hex: %s\n",
           $value,
           $color->formatRgb(),
           $color->formatHex());
}

```

### Output

[](#output)

```
$color->formatRgb();
$color->formatHex();

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/s4urp8n-css-color/health.svg)

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

###  Alternatives

[byte5/laravel-passgenerator

A Laravel package to create Apple Wallet (old Passbook) compatible tickets.

8821.3k](/packages/byte5-laravel-passgenerator)[soyhuce/next-ide-helper

Laravel ide helper rebuilt under steroids

4756.2k3](/packages/soyhuce-next-ide-helper)[usu/codice-fiscale

A library to calculate and check the validity of the italian fiscal code (codice fiscale)

23170.9k1](/packages/usu-codice-fiscale)[kzykhys/steganography

Simple implementation of Steganography (Hiding a hidden message within an image)

889.7k](/packages/kzykhys-steganography)[jxlwqq/watermark

generate text watermark with canvas

1014.8k](/packages/jxlwqq-watermark)

PHPackages © 2026

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