Random Stuff

colorHTML PHP Class

This is a really simple class that returns color codes from color names and vice-versa.

This class is intended to be used as a singleton,
so do not use "new"
create a new instance like this:
[codesyntax lang="php"]
$color = colorHTML::get_instance();
//returns 'red'.
//works with leading # or without: you can use:

//It also works in the other direction (color name to hex code):
//returns '#ff0000'

//you can also use:
$color->get_code('red', true);
//returns 'ff0000' (no leading '#')

This file is not copyrighted whatsoever and falls under the EK license,
found at http://www.yelostudio.com/ek_license.txt
meaning you can use it and modify it however you see fit.

download the source here


Category: Code, Free stuff

Tagged: , , , ,