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

ActiveLibrary

projectcleverweb/color
======================

This is a stand-alone PHP 7 (and PHP 5!) library for working with RGB, HSL, HSB/HSV, Hexadecimal, and CMYK colors. Create schemes, modify specific color properties, easily convert between color spaces, create gradients, and make color suggestions quickly and easily.

23954.4k↓47%8[2 issues](https://github.com/ProjectCleverWeb/PHP-Color/issues)PHP

Since Sep 6Pushed 7y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

PHP Color [![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://njordon.mit-license.org/@2016) [![Travis Build Status](https://camo.githubusercontent.com/9b75870a60c24cd7a7fcc11cfb5d131439c38d58103d4b84b2ab151a282f4ea7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f50726f6a656374436c657665725765622f5048502d436f6c6f722e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://travis-ci.org/ProjectCleverWeb/PHP-Color) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/89e61f35dadced71424f6a0003c90acfe7e15a34f0a579fbccf24e51ffdd7bc3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f50726f6a656374436c657665725765622f5048502d436f6c6f722e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ProjectCleverWeb/PHP-Color/) [![Scrutinizer Code Coverage](https://camo.githubusercontent.com/57b41dc97b50135b3da5e0215abb54580d32f15c505a6540a1846ac50ceaba38/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f50726f6a656374436c657665725765622f5048502d436f6c6f722e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ProjectCleverWeb/PHP-Color/) [![Code Climate Code GPA](https://camo.githubusercontent.com/cc94319bd99a6fe822525688701e8da219714f4d8003a0c29252a421b9ea35a3/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f6b61626973616963742f666c6f772e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://codeclimate.com/github/ProjectCleverWeb/PHP-Color)
=======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#php-color------)

This is a PHP 7 library for working with RGB, HSL, and Hexadecimal colors. Create schemes, modify specific color properties, export CMYK, and make color suggestions quickly and easily with this stand-alone library.

Demo: [jsfiddle.net/t3LL4q14](http://jsfiddle.net/t3LL4q14/embedded/result/)

### Download:

[](#download)

[![GitHub release](https://camo.githubusercontent.com/2d74eec55d1bdc81c58b19b192a3f7a24a3cfaaf09fdd8ee2164de9e925712ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f50726f6a656374436c657665725765622f5048502d436f6c6f722e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://github.com/ProjectCleverWeb/PHP-Color/releases)

Copyright © 2016 Nicholas Jordon — All Rights Reserved

Features
--------

[](#features)

- Convert any color between the RGB, HSL, HSB, Hexadecimal, and CMYK color spectrums.
- Dynamically generate 10 different color scheme algorithims for any color. (That's over 165,000,000 possible schemes)
- Check whether a color appears visually dark or light. (uses [YIQ](https://en.wikipedia.org/wiki/YIQ) weights for better accuraccy)
- Easily modify a color's hue, saturation, light, red, green, blue, and alpha (transparcency) values.
- Generate CSS values on the fly
- Find the contrast between 2 colors.
- Dynamically generate random colors, including for specific color ranges.
- All errors are recoverable, and errors can be triggered as exceptions (default), using `trigger_error()`, or can be turned off for all instances.

Installation &amp; Usage
------------------------

[](#installation--usage)

See the [Official Wiki on Github](https://github.com/ProjectCleverWeb/PHP-Color/wiki) for all documentation.

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

[](#contributing)

**Contributing *via* Suggestions:**
The best way to submit a suggestion is to open an issue on Github and prefix the title with `[Suggestion]`. Alternatively, you can email your suggestions to projectcleverweb(at)gmail(dot)com.

**Contributing *via* Reporting Problems:**
All problems must be reported via Github's [issue tracker](https://github.com/ProjectCleverWeb/PHP-Color/issues).

**Contributing *via* Code:**

1. Fork the repo on Github: [github.com/ProjectCleverWeb/PHP-Color](https://github.com/ProjectCleverWeb/PHP-Color)
2. Make your changes.
3. Send a pull request to have your changes reviewed.

License
-------

[](#license)

The PHP-Color documentation &amp; source code (hereafter referred to as "Library") by Nicholas Summers (hereafter referred to as "Author") is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License with the below "Additional Terms" superseding it. To view a copy of the Creative Commons license, visit [creativecommons.org/licenses/by-nc-nd/4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/). From now on "License" refers to this combination of licensing.

**Additional Terms:**

1. Any person or non-profit entity or may use this Library for personal or professional use as long as the Library as well as any of its parts are not sold in any fashion, and users are not forced to pay to use it in any way.
2. Anyone may use this Library for purely internal use as long as the Library as well as any of its parts are available without payment and are not publicly accessible.
3. Anyone seeking to sell this Library or use this Library in a commercial environment MUST first obtain a OEM license from the Author.
4. Anyone in direct violation of this License is liable for a minimum of $50,000 in damages, plus an additional $10 per user, and agrees to refund any charge or fees collected as a result of violating this License.
5. By downloading or using this Library you agree to all the License terms.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/974e725859b1a78b5d234748e489409f1654caa31a1f0e9e8aa32a9a212c7f06?d=identicon)[ProjectCleverWeb](/maintainers/ProjectCleverWeb)

---

Top Contributors

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

---

Tags

colorcolor-palettecolor-schemeexport-cmykhexadecimal-colorhsllightphpphp-colorphp-libraryphp7rgbscheme

### Embed Badge

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

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

PHPackages © 2026

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