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])); } Quote 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... Quote Link to comment https://forums.phpfreaks.com/topic/250817-hextorbg-critic-please/#findComment-1286881 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.