Jump to content

Convert Hex to RGB


johnsmith153

Recommended Posts

So,

 

You want to convert the hex AABBCC to decimal XXXYYYZZZ then take the last set and subtract 128 and see if it's a positive number or not?

 

:D

 

http://us2.php.net/hexdec

 

<?php

var_dump(hexdec("See"));

var_dump(hexdec("ee"));

// both print "int(238)"

 

var_dump(hexdec("that")); // print "int(10)"

var_dump(hexdec("a0")); // print "int(160)"

?>

 

Link to comment
https://forums.phpfreaks.com/topic/128044-convert-hex-to-rgb/#findComment-663041
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.