If you want to convert hex to rgb you can use sscanf:
<?php
$hex = "#ff9900";
list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
echo "$hex -> $r $g $b";
?>
Output:
#ff9900 -> 255 153 0
More Related Contents:
- RGB to HSV in PHP
- PHP HSV to RGB formula comprehension
- PHP allocate color without image resource
- RGB to hex and hex to RGB
- How to get hex color value rather than RGB value?
- How can I get a hex dump of a string in PHP?
- PHP convert string to hex and hex to string
- Converting an RGB color tuple to a hexidecimal string
- Converting hex color to RGB and vice-versa
- Get image color
- Easiest way to alternate row colors in PHP/HTML?
- Colorizing Windows command line output from PHP
- Generating a random hex color code with PHP
- RGB to closest predefined color
- Are there any good reasons for using hex over decimal for RGB colour values in CSS?
- PHP – Replace colour within image
- “Distance” between colours in PHP
- Large hex values with PHP hexdec
- How do I replace characters not in range [0x5E10, 0x7F35] with ‘*’ in PHP?
- PHP echo vs PHP short echo tags
- base_url() function not working in codeigniter
- how to replace special characters with the ones they’re based on in PHP?
- How do I make a PHP form that submits to self?
- Delete digits after two decimal points, without rounding the value
- PHP – Convert multidimensional array to 2D array with dot notation keys
- Magento – Retrieve products with a specific attribute value
- How to place two forms on the same page?
- .htaccess mod_rewrite > 500 Internal Server Error
- Why does an infinitely recursive function in PHP cause a segfault?
- How to get the shortest rather than longest possible regex match with preg_match()