Skip to content

Instantly share code, notes, and snippets.

@trevorgreenleaf
Created July 6, 2015 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevorgreenleaf/ea489e253698048381e9 to your computer and use it in GitHub Desktop.
Save trevorgreenleaf/ea489e253698048381e9 to your computer and use it in GitHub Desktop.
HEX to RGB PHP
/**
* @return an array of rgb values
*/
protected function hex2rgb($hex = null ){
return sscanf($hex, "#%02x%02x%02x");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment