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

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

artack/color
============

Color helper library for converting between RGB, CMYK, HSV, HST and HEX and create interpolation.

0.6.0(3y ago)523.0k↓50%1MITPHPPHP ^7.4|^8.0

Since Dec 11Pushed 2y agoCompare

[ Source](https://github.com/artack/color)[ Packagist](https://packagist.org/packages/artack/color)[ RSS](/packages/artack-color/feed)WikiDiscussions master Synced 1mo ago

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

artack/color
============

[](#artackcolor)

> color conversions and transitions (e.g. interpolation).

[![Latest Release](https://camo.githubusercontent.com/66b2ad59c037e1f183c072d2ccf0a352c754177d284f97a723f5111a8639c3e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61727461636b2f636f6c6f722e737667)](https://packagist.org/packages/artack/color)[![MIT License](https://camo.githubusercontent.com/a8fedb2d29b54994b77a4ebf24088a48c3678fb798151ccea401998de2138d11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61727461636b2f636f6c6f722e737667)](http://opensource.org/licenses/MIT)[![Total Downloads](https://camo.githubusercontent.com/086f4fad97bab4e6a92d22250f45d78d4ba3040373982d8bc115dcb4428dc22d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61727461636b2f636f6c6f722e737667)](https://packagist.org/packages/artack/color)

Developed by [ARTACK WebLab GmbH](https://www.artack.ch) in Zurich, Switzerland.

Features
--------

[](#features)

- Provides class representation for **RGB**, **CMYK**, **HSV**, **HSL** and **HEX**.
- Provides conversion between all class representation
- Provides transitions between colors (e.g. interpolation)
- Provides clear exceptions to be able to handle library exceptions
- Compatible with PHP &gt;= 7 and &gt;= 8.

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

[](#installation)

You can install this color library through [Composer](https://getcomposer.org):

```
$ composer require artack/color
```

Usage
-----

[](#usage)

Creating a RGB class representation:

```
$RGB = new RGB(0, 255, 0);
echo $RGB->getGreen(); // 255
```

Translate RGR class representation to HSV:

```
$converter = Factory::createConverter();
$RGB = new RGB(0, 255, 0);

$HSV = $converter->convert($RGB, HSV::class);
```

Get an interpolation color between two colors with the value (and max) given:

```
$transition = Factory::createTransition();

$RGBRed = new RGB(255, 0, 0); // red
$RGBGreen = new RGB(0, 255, 0); // green

$RGBInterpolated = $transition->interpolate(RGB::class, $RGBRed, $RGBGreen, 100, 200); // should be ~yellow

// Interpolation will give better results when using HSV Transition. Colors get converted automatically if needed.
$HSVInterpolated = $transition->interpolate(HSV::class, $RGBRed, $RGBGreen, 100, 200); // should be ~yellow
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~283 days

Recently: every ~425 days

Total

7

Last Release

1378d ago

PHP version history (2 changes)0.0.1PHP ^7.0

0.6.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a960d5235efdb31dc5e6266966529a26f2ee271978555895a7a7119a74455b7?d=identicon)[scube](/maintainers/scube)

---

Top Contributors

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

---

Tags

cmykcolorconvertionhexhsvinterpolationphprgbconversioncolorinterpolation

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[spatie/color

A little library to handle color conversions

38118.9M28](/packages/spatie-color)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[florianv/swap

Exchange rates library for PHP

1.3k6.4M16](/packages/florianv-swap)[mexitek/phpcolors

A series of methods that let you manipulate colors. Just incase you ever need different shades of one color on the fly.

5003.6M18](/packages/mexitek-phpcolors)[php-units-of-measure/php-units-of-measure

A PHP library for converting between standard units of measure.

3123.4M20](/packages/php-units-of-measure-php-units-of-measure)[ssnepenthe/color-utils

A PHP library for performing SASS-like color manipulations.

631.1M10](/packages/ssnepenthe-color-utils)

PHPackages © 2026

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