florianwolters/component-drawing-color

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

v0.1.0 2013-06-29 11:48 UTC

This package is not auto-updated.

Last update: 2024-03-16 12:22:51 UTC


README

Build Status

FlorianWolters\Component\Drawing\Color is a simple-to-use PHP component that offers models and operations on objects related to colors.

Introduction

This component is inspired by the structure System.Drawing.Color of the .NET Framework.

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

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

Features

Requirements

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 repository, which on Linux systems is normally /usr/share/php/test.

Installation

Local Installation

FlorianWolters\Component\Drawing\Color should be installed using the dependency manager Composer. Composer can be installed with PHP.

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

This will just check a few PHP settings and then download composer.phar to your working directory. This file is the Composer binary. It is a PHAR (PHP archive), which is an archive format for PHP 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

FlorianWolters\Component\Drawing\Color should be installed using the PEAR installer. This installer is the PHP community's de-facto standard for installing PHP components.

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

As A Dependency On Your Component

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

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:

<dependencies>
  <required>
    <package>
      <name>Color</name>
      <channel>pear.florianwolters.de</channel>
      <min>0.1.0</min>
      <max>0.1.99</max>
    </package>
  </required>
</dependencies>

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:

# 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) have been automated using 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

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 http://gnu.org/licenses/lgpl.txt.