Jump to content

[SOLVED] GD library hex


taith

Recommended Posts

:-P found my own answer :P thanks anyways :-)

 

function hex_to_rgb($hex){
if(substr($hex,0,1) == '#') $hex = substr($hex,1) ;
if(strlen($hex) == 3) $hex = substr($hex,0,1).substr($hex,0,1).substr($hex,1,1).substr($hex,1,1).substr($hex,2,1).substr($hex,2,1);
$rgb['red'] = hexdec(substr($hex,0,2)) ;
$rgb['green'] = hexdec(substr($hex,2,2)) ;
$rgb['blue'] = hexdec(substr($hex,4,2)) ;
return $rgb ;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.