2017 © Pedro Peláez
 

library color

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

image

artack/color

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

  • Monday, December 18, 2017
  • by scube
  • Repository
  • 2 Watchers
  • 3 Stars
  • 57 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

artack/color

color conversions and transitions (e.g. interpolation)., (*1)

Latest Release MIT License Total Downloads, (*2)

Developed by ARTACK WebLab GmbH in Zurich, Switzerland., (*3)

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 >= 7 and >= 8.

Installation

You can install this color library through Composer:, (*4)

$ composer require artack/color

Usage

Creating a RGB class representation:, (*5)

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

Translate RGR class representation to HSV:, (*6)

$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:, (*7)

$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

The Versions

18/12 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

conversion color interpolation

16/12 2017

0.5.0

0.5.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

conversion color interpolation

13/12 2017

0.4.0

0.4.0.0

Color helper functions like conversion.

  Sources   Download

MIT

The Requires

 

The Development Requires

conversion color

12/12 2017

0.3.0

0.3.0.0

Color helper functions like conversion.

  Sources   Download

MIT

The Requires

 

The Development Requires

conversion color

12/12 2017

0.2.0

0.2.0.0

Color helper functions like conversion.

  Sources   Download

MIT

The Requires

 

The Development Requires

conversion color

12/12 2017

0.1.0

0.1.0.0

Color helper functions like conversion.

  Sources   Download

MIT

The Requires

 

The Development Requires

conversion color

11/12 2017

0.0.1

0.0.1.0

Color helper functions like conversion.

  Sources   Download

MIT

The Requires

 

The Development Requires

conversion color