View Full Version : function for splitting a color code into red green blue

05-28-2007, 03:31 PM
I know such a function exists but I can't remember it's name

if you know please tell

thank you

05-28-2007, 04:11 PM
what are you taking as input, and what would you want as output?

something like:

$split = str_split($string,2);
$r = hexdec($split[0]);
$g = hexdec($split[1]);
$b = hexdec($split[2]);


05-29-2007, 08:36 AM
I know about this but there is a function that does this automatically. A function for color codes. A specific function.

05-29-2007, 01:01 PM
A built-in php function? Never heard of it.

Here's a substitute (http://www.anyexample.com/programming/php/php_convert_rgb_from_to_html_hex_color.xml)