Convert Hex color to RGB color using below PHP function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// HEX TO PHP function hexcolorToRgbcolor($hex){ $hex = ltrim($hex, '#'); $chr = strlen($hex) / 3; if ($chr == 1 || $chr == 2) { list($r, $g, $b) = str_split($hex, $chr); return array( 'r' => hexdec($r), 'g' => hexdec($g), 'b' => hexdec($b) ); } else { return false; } } |
More Stories
CPU & Memory usage in PHP
Install PHP mcrypt extension on Ubuntu
Text to speech