Well, the title says it all, I am calling @primaryMedium which needs to be in HEX format... but it's giving me in rgb(x, y, z) format...
Thanks!
Thanks!
function rgb2hex($rgb)
{
$hex = "#";$hex .= str_pad(dechex($rgb[0]), 2, "0", STR_PAD_LEFT);$hex .= str_pad(dechex($rgb[1]), 2, "0", STR_PAD_LEFT);$hex .= str_pad(dechex($rgb[2]), 2, "0", STR_PAD_LEFT);return $hex; // returns the hex value including the number sign (#)}
$rgb = str_replace(' ', '', $rgb) //just to make sure...
$rgb = explode(',', $rgb);
because i am fetching the style property automatically...Why not just using a Converter?
I didn't ask, but I assume because he needs to do it programmatically for an add-on he's writing.Why not just using a Converter?
We use essential cookies to make this site work, and optional cookies to enhance your experience.