Feb
18
2008

Simple function to parse RGB value

Here’s a simple function to parse RGB string (#00ff00) into array, so it can be used in GD functions.
Hope it can save a little time for you.


list($r, $g, $b)= parse_RGB("#123456");

function parse_RGB($color)
{
$r= hexdec(substr($color, 1, 2));
$g= hexdec(substr($color, 3, 2));
$b= hexdec(substr($color, 5, 2));
return array($r, $g, $b);
}

Written by hkai in: PHP |

1 Comment »

  • caz

    Does anyone have experience of mobile broadband coverage in Cornwall? I travel down their regularly and am thinking about signing up with a mobile broadband provider but have heard coverage can be poor in some rural areas. I’ve been looking at various different mobile broadband providers here: http://www.broadband-expert.co.uk/broadband/mobile and am leaning towards Vodafone.

    Any advice would be great. I don’t want to sign up and find I’m paying for a product that doesn’t work!

    Comment | May 16, 2008

RSS feed for comments on this post. TrackBack URL

Leave a comment

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes