Skip Navigation

Simple HEX to RGB in PHP

/**
* @return an array of rgb values
*/
protected function hex2rgb($hex = null ){
    return sscanf($hex, "#%02x%02x%02x");
}

Related Snippets

See all