PHPackages                             florianwolters/component-drawing-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. florianwolters/component-drawing-color

ActiveLibrary

florianwolters/component-drawing-color
======================================

Models and operations on objects related to colors as a PHP component.

v0.1.0(12y ago)033LGPL-3.0+PHPPHP &gt;=5.4

Since Jun 29Pushed 12y ago1 watchersCompare

[ Source](https://github.com/FlorianWolters/PHP-Component-Drawing-Color)[ Packagist](https://packagist.org/packages/florianwolters/component-drawing-color)[ Docs](http://github.com/FlorianWolters/PHP-Component-Drawing-Color)[ RSS](/packages/florianwolters-component-drawing-color/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

FlorianWolters\\Component\\Drawing\\Color
=========================================

[](#florianwolterscomponentdrawingcolor)

[![Build Status](https://camo.githubusercontent.com/6253fdd3cdb9ecd18c45303c6b1dcb43698b0e7008830b9497191edf29bbf09e/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f466c6f7269616e576f6c746572732f5048502d436f6d706f6e656e742d44726177696e672d436f6c6f722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/FlorianWolters/PHP-Component-Drawing-Color)

**FlorianWolters\\Component\\Drawing\\Color** is a simple-to-use [PHP](http://php.net "PHP: Hypertext Preprocessor") component that offers models and operations on objects related to colors.

Introduction
------------

[](#introduction)

This component is inspired by the structure [`System.Drawing.Color`](http://msdn.microsoft.com/library/system.drawing.color "Color Structure (System.Drawing)") of the [.NET Framework](http://msdn.microsoft.com/vstudio/aa496123 ".NET Framework").

**FlorianWolters\\Component\\Drawing\\Color** consists of four artifacts:

1. The interface [`FlorianWolters\Component\Drawing\Color\ColorInterface`](src/php/FlorianWolters/Component/Drawing/Color/ColorInterface.php "FlorianWolters\Component\Drawing\Color\ColorInterface"): Indicates that an implementing class implements a color model.
2. The class [`FlorianWolters\Component\Drawing\Color\CmykColor`](src/php/FlorianWolters/Component/Drawing/Color/CmykColor.php "FlorianWolters\Component\Drawing\Color\CmykColor"): Wraps the color model *CMYK* in an object.
3. The class [`FlorianWolters\Component\Drawing\Color\RgbaColor`](src/php/FlorianWolters/Component/Drawing/Color/RgbaColor.php "FlorianWolters\Component\Drawing\Color\RgbaColor"): Wraps the color model *RGB(A)* in an object.
4. The utility class [`FlorianWolters\Component\Drawing\Color\ColorUtils`](src/php/FlorianWolters/Component/Drawing/Color/ColorUtils.php "FlorianWolters\Component\Drawing\Color\ColorUtils"): Offers operations to translate color models.

Features
--------

[](#features)

- Artifacts tested with both static and dynamic test procedures:
    - Dynamic component tests (unit tests) implemented using [PHPUnit](http://phpunit.de "sebastianbergmann/phpunit · GitHub").
    - Static code analysis performed using the following tools:
        - [PHP\_CodeSniffer](http://pear.php.net/package/PHP_CodeSniffer "PHP_CodeSniffer"): Style Checker
        - [PHP Mess Detector (PHPMD)](http://phpmd.org "PHPMD - PHP Mess Detector"): Code Analyzer
        - [phpcpd](https://github.com/sebastianbergmann/phpcpd "sebastianbergmann/phpcpd · GitHub"): Copy/Paste Detector (CPD)
        - [phpdcd](https://github.com/sebastianbergmann/phpdcd "sebastianbergmann/phpdcd · GitHub"): Dead Code Detector (DCD)
- Installable via [Composer](http://getcomposer.org "Composer") or the [PEAR command line installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php "Manual :: Command line installer (PEAR)"):
    - Provides a [Packagist](http://packagist.org "Packagist") package which can be installed using the dependency manager [Composer](http://getcomposer.org "Composer"). Click [here](http://packagist.org/packages/florianwolters/component-drawing "florianwolters/component-drawing - Packagist") for the package on [Packagist](http://packagist.org "Packagist").
    - Provides a [PEAR package](http://pear.php.net/manual/en/guide.users.concepts.package.php "Manual :: PEAR Packages") which can be installed using the package manager [PEAR installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php "Manual :: Command line installer (PEAR)"). Click [here](http://pear.florianwolters.de "PEAR channel of Florian Wolters") for the [PEAR channel](http://pear.php.net/manual/en/guide.users.concepts.channel.php "Manual :: PEAR Channels").
- Provides a complete Application Programming Interface (API) documentation generated with the documentation generator [ApiGen](http://apigen.org "ApiGen | API documentation generator for PHP 5.3.+"). Click [here](http://florianwolters.github.com/PHP-Component-Drawing-Color "FlorianWolters\Component\Drawing\Color | Application Programming Interface (API) documentation") for the current API documentation.
- Follows the [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md "PSR-0 requirements for autoloader interoperability") requirements for autoloader interoperability.
- Follows the [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md "PSR-1 basic coding style guide") basic coding style guide.
- Follows the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md "PSR-2 coding style guide") coding style guide.
- Follows the [Semantic Versioning](http://semver.org "Semantic Versioning") Specification (SemVer) 2.0.0-rc.1.

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

[](#requirements)

- [PHP](http://php.net "PHP: Hypertext Preprocessor") &gt;= 5.4

Usage
-----

[](#usage)

The best documentation for **FlorianWolters\\Component\\Drawing\\Color** are the unit tests, which are shipped in the package. You will find them installed into your [PEAR](http://pear.php.net "PEAR - PHP Extension and Application Repository") repository, which on Linux systems is normally `/usr/share/php/test`.

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

[](#installation)

### Local Installation

[](#local-installation)

**FlorianWolters\\Component\\Drawing\\Color** should be installed using the dependency manager [Composer](http://getcomposer.org "Composer"). [Composer](http://getcomposer.org "Composer") can be installed with [PHP](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md "PSR-0 requirements for autoloader interoperability").

```
php -r "eval('?>'.file_get_contents('http://getcomposer.org/installer'));"

```

> This will just check a few [PHP](http://php.net "PHP: Hypertext Preprocessor") settings and then download `composer.phar` to your working directory. This file is the [Composer](http://getcomposer.org "Composer") binary. It is a PHAR ([PHP](http://php.net "PHP: Hypertext Preprocessor") archive), which is an archive format for [PHP](http://php.net "PHP: Hypertext Preprocessor") which can be run on the command line, amongst other things.
>
> Next, run the `install` command to resolve and download dependencies:

```
php composer.phar install

```

### System-Wide Installation

[](#system-wide-installation)

**FlorianWolters\\Component\\Drawing\\Color** should be installed using the [PEAR installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php "Manual :: Command line installer (PEAR)"). This installer is the [PHP](http://php.net "PHP: Hypertext Preprocessor") community's de-facto standard for installing [PHP](http://php.net "PHP: Hypertext Preprocessor") components.

```
pear channel-discover pear.florianwolters.de
pear install --alldeps fw/Color

```

As A Dependency On Your Component
---------------------------------

[](#as-a-dependency-on-your-component)

### Composer

[](#composer)

If you are creating a component that relies on **FlorianWolters\\Component\\Drawing\\Color**, please make sure that you add **FlorianWolters\\Component\\Drawing\\Color** to your component's `composer.json` file:

```
{
    "require": {
        "florianwolters/component-drawing-color": "dev-master"
    }
}
```

### PEAR

[](#pear)

If you are creating a component that relies on **FlorianWolters\\Component\\Drawing\\Color**, please make sure that you add **FlorianWolters\\Component\\Drawing\\Color** to your component's `package.xml` file:

```

      Color
      pear.florianwolters.de
      0.1.0
      0.1.99

```

Development Environment
-----------------------

[](#development-environment)

If you want to patch or enhance this component, you will need to create a suitable development environment. The easiest way to do that is to install [phix4componentdev](https://github.com/stuartherbert/phix4componentdev "stuartherbert/phix4componentdev · GitHub"):

```
# phix4componentdev
pear channel-discover pear.phix-project.org
pear install phix/phix4componentdev

```

You can then clone the Git repository:

```
# PHP-Component-Drawing-Color
git clone http://github.com/FlorianWolters/PHP-Component-Drawing-Color

```

Then, install a local copy of this component's dependencies to complete the development environment:

```
# build vendor/ folder
phing build-vendor

```

To make life easier for you, common tasks (such as running unit tests, generating code review analytics, and creating the [PEAR package](http://pear.php.net/manual/en/guide.users.concepts.package.php "Manual :: PEAR Packages")) have been automated using [phing](http://phing.info "Phing"). You'll find the automated steps inside the `build.xml` file that ships with the component.

Run the command `phing` in the component's top-level folder to see the full list of available automated tasks.

License
-------

[](#license)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see .

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

4700d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75dd7e42d69a87c4a0c68b4f29f5d223eb1f9a3f647abafa72da80d2a06d2442?d=identicon)[FlorianWolters](/maintainers/FlorianWolters)

---

Top Contributors

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

---

Tags

drawingconversioncolor

### Embed Badge

![Health badge](/badges/florianwolters-component-drawing-color/health.svg)

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

###  Alternatives

[imagine/imagine

Image processing for PHP

4.5k72.4M341](/packages/imagine-imagine)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k37.7M472](/packages/spatie-laravel-medialibrary)[spatie/color

A little library to handle color conversions

38018.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)[league/color-extractor

Extract colors from an image as a human would do.

1.3k4.7M18](/packages/league-color-extractor)

PHPackages © 2026

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