Getting RGB from Hexadecimal Colors
When working with CSS, it is common to use Hexadecimal Notation of colors, while on the back end, many PHP functions (like imagecolorallocate, imagecolorclosest, imagecolorexact etc, require that you pass on colors as red, green and blue
integers. This function can be helpful if you need to convert hexadecimal color literal to red, green and blue int values for use elsewhere. This function accepts hex, converts to RGB and stores the respective color values in $red, $green and $blue variables passed by reference.