Convert HTML/Hexadecimal Values to RGB equivalent in PHP
Following Code will convert the Hex Values to RGB.
$hexColors = ’#F13196′;
$hexColors = substr($hexColors,1);
$r=(GiveDec(substr($hexColors,0,1))*16)+GiveDec(substr($hexColors,1,1));
$g=(GiveDec(substr($hexColors, 2,1))*16)+GiveDec(substr($hexColors,3,1));
$b=(GiveDec(substr($hexColors,4,1))*16)+GiveDec(substr($hexColors,5,1));
Now $r,$g,$b contains reg,green and blue values respectively.
