Skip to content

siddarthpushparaj/ColorMap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This class was designed to convert string color names like 'yellow' into entities with all the tech properties needed to display the color (hex-code, rgb, cmyk). It uses a csv map as reference. The map contains 950+ colors.

Note. Only Russian color names are currently supported! English support is scheduled.

What is it for?

This class can be handy in a an application, where colors are stored by names only and visual color samples needed.

Usage

Install the class by issuing git clone git://github.com/yentsun/ColorMap.git in some folder your project has access to and then:

<?php

require 'ColorMap/Color.php';

$color = new Color('Белый');

print $color->clean_name; // белый
print $color->hsv; // 0,0,100
print $color->rgb; // 255,255,255
print $color->cmyk; // 0,0,0,0
print $color->hex; // FFFFFF

About

A php class that maps color names and their hex, rgb, cmyk representation

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%