-
-
Save parzibyte/bc56755458b62ed31a3f5eef0db62c37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
https://parzibyte.me/blog | |
*/ | |
function hexadecimalARgb($hexadecimal) | |
{ | |
list($r, $g, $b) = sscanf($hexadecimal, "#%02x%02x%02x"); | |
return [$r, $g, $b]; | |
} | |
$colorHexadecimal = "#8BC34A"; | |
$rgb = hexadecimalARgb($colorHexadecimal); | |
# Ahora tenemos a R en $rgb[0], G en $rgb[1] y B en $rgb[2] | |
print_r($rgb); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment