My $_POST value contains css friendly hex color value, for example: #ffffff. In order to make it friendly towards the ColorJizz library, I should have it in hexadecimal integer value. The code below doesn't work. If I replace the $color_hex variable with a hard coded value for example: 0xffffff, it works.
include('colorjizz.php');
$color_hex = '0x' . substr($_POST['color'], 1);
$color = new Hex($color_hex);
This is most likely a very noob level problem, but after hitting my head to the wall for a quite few hours, I'd be grateful for any advice. Thank you.
(int)at the front?$color_hexin this example? I can't see an issue with it, assuming you are indeed getting a valid 6 digit hex value for$_POST['color'], WITH the # number sign character.