Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeemoo/ColorJizz-PHP
ColorJizz is a PHP library for manipulating and converting colors.
https://github.com/mikeemoo/ColorJizz-PHP
Last synced: about 2 months ago
JSON representation
ColorJizz is a PHP library for manipulating and converting colors.
- Host: GitHub
- URL: https://github.com/mikeemoo/ColorJizz-PHP
- Owner: mikeemoo
- Created: 2012-06-14T16:37:06.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2023-07-07T20:06:31.000Z (12 months ago)
- Last Synced: 2024-05-02T11:18:03.734Z (about 2 months ago)
- Language: PHP
- Homepage:
- Size: 423 KB
- Stars: 290
- Watchers: 14
- Forks: 31
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Lists
- awesome-php - Color Jizz - A library for manipulating and converting colors. (Table of Contents / Strings)
- awesome-projects - Color Jizz - A library for manipulating and converting colours. (PHP / Strings)
- awesome-php - Color Jizz - A library for manipulating and converting colors. (Table of Contents / Strings)
- awesome-php-zh_CN - Color Jizz - 处理和转换颜色的库 (字符串 Strings)
- awesome-php - Color Jizz - A library for manipulating and converting colours. (Strings)
- awesome-php-new - Color Jizz - A library for manipulating and converting colours. (Table of Contents / Strings)
- awesome-php - Color Jizz - A library for manipulating and converting colours. (Strings)
- awesome-php - Color Jizz - A library for manipulating and converting colours. (Table of Contents / Strings)
- awesome-php - Color Jizz - A library for manipulating and converting colours. (Table of Contents / Strings)
- awesome-php - Color Jizz - 一个处理和转换颜色的库 (字符串( Strings ))
- awesome-stars - ColorJizz-PHP - ColorJizz is a PHP library for manipulating and converting colors. (PHP)
- awesome-stripe - Color Jizz - A library for manipulating and converting colours. (Table of Contents / Strings)
- PHP_awesome-directus-duh-REKT-iss- - Color Jizz - A library for manipulating and converting colours. (Table of Contents / Strings)
- awesome-php - Color Jizz - 一个处理和转换颜色的库 (URL)
- awesome-php - Color Jizz - A library for manipulating and converting colours. (Table of Contents / Strings)
- awesome-php - Color Jizz - A library for manipulating and converting colors. (Table of Contents / Strings)
- awesome-php - Color Jizz - A library for manipulating and converting colours. (Table of Contents / Strings)
- awesome-php-cn - Color Jizz - 一个图书馆操纵和转换颜色. (目录 / 字符串 Strings)
- awesome-php-cn - 官网
- awesome-php-cn - 官网
- awesome-php - mikeemoo/ColorJizz-PHP - 一个处理和转换颜色的库 (字符串( Strings ))
README
#Getting started:
ColorJizz-PHP uses the PSR-0 standards for namespaces, so there should be no trouble using with frameworks like Symfony 2.
###Autoloading
An autoloader class is provided for when loading ColorJizz yourself.
First, include the autoloader and call the static register() function.
```php
```
Now all ColorJizz classes will be automatically loaded in.
###Converting between formats
ColorJizz can convert to and from any of the supported color formats:
```php
toCMYK();echo get_class($red_cmyk); // MischiefCollective\ColorJizz\Formats\CMYK
echo $red_cmyk; // 0,1,1,0
?>
```Any color manipulation or conversion will return a new instance of a color class, therefore your original color objects remains intact.
Color manipulation can be chained together:
```php
hue(-20)->greyscale(); // 555555
?>
```Any color manipulation will always return the color in the same format unless you're specifically converting the format. For example:
```php
hue(-20)->saturation(2)); // MischiefCollective\ColorJizz\Formats\RGB
?>
```###Supported formats:
```php
toRGB();
->toCMY();
->toCMYK();
->toHex();
->toHSV();
->toCIELab();
->toCIELCh();
->toXYZ();
->toYxy();
```