PHPackages                             abyrate/colorist - 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. abyrate/colorist

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

abyrate/colorist
================

Package for color manipulation

v2.0.2(7y ago)110MITPHPPHP &gt;=7.1

Since Jan 19Pushed 7y ago2 watchersCompare

[ Source](https://github.com/abyrate/colorist)[ Packagist](https://packagist.org/packages/abyrate/colorist)[ RSS](/packages/abyrate-colorist/feed)WikiDiscussions master Synced 3d ago

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

Colorist
========

[](#colorist)

[![PHP version](https://camo.githubusercontent.com/007defed595ea130643a3fd3d4b7fc49d9d29fd090225206ea73c09277ead644/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616279726174652f636f6c6f726973742e737667)](https://camo.githubusercontent.com/007defed595ea130643a3fd3d4b7fc49d9d29fd090225206ea73c09277ead644/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616279726174652f636f6c6f726973742e737667)[![Latest Stable Version](https://camo.githubusercontent.com/2513e547feb3911db2da0f89f8d077bf0e439717996ec3c6bf6b51d573da1b21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616279726174652f636f6c6f726973742e737667)](https://packagist.org/packages/abyrate/colorist)[![Build Status](https://camo.githubusercontent.com/aee074732d3df7d6bb46e5ddb5ed67e9c02d8cbfa5370654bb01dc6e7a799765/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616279726174652f636f6c6f726973742f6d61737465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/abyrate/colorist)[![codecov](https://camo.githubusercontent.com/41bf10656c6ab25e0c652b18b92cd1b411c93852594e24ca8ebe69490edced5a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f616279726174652f636f6c6f726973742f6d61737465722e737667)](https://codecov.io/gh/abyrate/colorist)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2c04fba7d2464d923110d6e0fe832a213de2abe04c28e64535a8b1bc910c8e79/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616279726174652f636f6c6f726973742e7376673f623d6d6173746572)](https://scrutinizer-ci.com/g/abyrate/colorist/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/9638318e0d6dd2ee297f1d033107742290db5742cd7e0c3532391424cc563f12/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616279726174652f636f6c6f726973742e737667)](https://packagist.org/packages/abyrate/colorist)[![License](https://camo.githubusercontent.com/73428794b70903f6e673fabf2c0e28a22c27fca0457a5d618820b22358c0ffb1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616279726174652f636f6c6f726973742e737667)](https://packagist.org/packages/abyrate/colorist)

This package allows you to convert and manage color models.

Supported color models
----------------------

[](#supported-color-models)

- RGB (RGBA)
- HEX (HEXA)
- html colors names

> Short hex code is supported (#001122, #012, #00112233, #0123)

> List of names colors you can see [here](https://github.com/abyrate/colorist/blob/master/src/Models/Name.php#L26)

In the plans
------------

[](#in-the-plans)

- HSL (HSLA)
- HSV (HSVA)
- CMYK
- Lab

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1

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

[](#installation)

Run command

```
$ composer require abyrate/colorist

```

Or add the following in your root composer.json file:

```
{
	"require": {
		"abyrate/colorist": "~2.0"
	}
}
```

and run command:

```
$ composer update

```

Usage
-----

[](#usage)

> If you change the values of any model, the rest are automatically updated

### Create

[](#create)

```
// Create an object in the standard way
$color = new \Abyrate\Colorist('rgb(55,191,0)');

// Create using static method
$color = \Abyrate\Colorist::create('rgb(55,191,0)');
```

Supported syntax:

- 'rgb(0,0,0)' - rgb model
- 'rgba(0,0,0,0)' - rgb model with alpha channel
- '#000000' - hex model
- '#00000000' - hex model with alpha channel
- 'orange' - name model

Range of channels:

- r, g, b - 0-255 (in the hex 00-ff)
- alpha - 0-1 (float value. In the hex 00-ff)

### Get

[](#get)

#### Channels

[](#channels)

```
$colorist->getChannel('red');   // get red channel
$colorist->getChannel('green'); // get green channel
$colorist->getChannel('blue');  // get blue channel
$colorist->getChannel('alpha'); // get alpha channel
$colorist->getChannel('hex');   // get hex code (e.g. #15af45)
$colorist->getChannel('hexa');  // get hex code with alpha (e.g. #15af4505)
$colorist->getChannel('name');  // get color name (e.g. orange)
```

#### Models

[](#models)

```
$colorist->get('rgb');  // get rgb string (e.g. 15,156,10)
$colorist->get('rgba'); // get rgb string with alpha channel (e.g. 15,156,10,0.3)
$colorist->get('hex');  // get rgb in the hex format string (e.g. #15af45)
$colorist->get('hexa'); // get rgb with alpha channel in hex string (e.g. #15af4505)
$colorist->get('name'); // get color name (e.g. orange)
```

### Set

[](#set)

#### Channels

[](#channels-1)

```
$colorist->setChannel('red', 15);           // set red channel
$colorist->setChannel('green', 20);         // set green channel
$colorist->setChannel('blue', 25);          // set blue channel
$colorist->setChannel('alpha', 0.3);        // set alpha channel
$colorist->setChannel('hex', '#004');       // set hex code
$colorist->setChannel('hexa', '#00112233'); // set hex code with alpha
$colorist->setChannel('name', 'orange');    // set color name
```

#### Models

[](#models-1)

```
$colorist->set('rgb', 'rgb(0,15,36)');       // set rgb string
$colorist->set('rgba', 'rgb(0,15,36, 0.1)'); // set rgb string with alpha channel
$colorist->set('hex', '#123');               // set rgb in the hex format string
$colorist->set('hexa', '#1234');             // set rgb with alpha channel in hex string
$colorist->set('name', 'orange');            // set color name (e.g. orange)
```

[API documentation](https://abyrate.github.io/colorist/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 84.2% 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 ~17 days

Recently: every ~42 days

Total

11

Last Release

2866d ago

Major Versions

v1.1.1 → v2.0.02018-07-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/6114e60e255ecfff3c9645ab77142067490ad526b9854e8e0e0bee0b17c9c81c?d=identicon)[aboldyrev](/maintainers/aboldyrev)

---

Top Contributors

[![asboldyrev](https://avatars.githubusercontent.com/u/15995789?v=4)](https://github.com/asboldyrev "asboldyrev (64 commits)")[![andyboldyrev](https://avatars.githubusercontent.com/u/32055688?v=4)](https://github.com/andyboldyrev "andyboldyrev (11 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

color-manipulationcolorscomposer-packagephp7

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[optimistdigital/nova-resizable

Simple Laravel Nova tool to enable column resizing

1818.9k](/packages/optimistdigital-nova-resizable)

PHPackages © 2026

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