RobertP Posted November 10, 2011 Share Posted November 10, 2011 maybe there is a better way? function hexToRBG($hex){ $bytes = str_split($hex); return array(hexdec($bytes[0].$bytes[1]),hexdec($bytes[2].$bytes[3]),hexdec($bytes[4].$bytes[5])); } Link to comment https://forums.phpfreaks.com/topic/250817-hextorbg-critic-please/ Share on other sites More sharing options...
RobertP Posted November 10, 2011 Author Share Posted November 10, 2011 maybe there is a better way? function hexToRBG($hex){ $bytes = str_split($hex); return array(hexdec($bytes[0].$bytes[1]),hexdec($bytes[2].$bytes[3]),hexdec($bytes[4].$bytes[5])); } edit: this will only support 'FFFFFF' NOT 'FFF', html5 standards... Link to comment https://forums.phpfreaks.com/topic/250817-hextorbg-critic-please/#findComment-1286881 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.