je googlé sur une fonction comment convertir hex rgb code couleurComment echo tableau retour
<?php
function html2rgb($color)
{
if ($color[0] == '#')
$color = substr($color, 1);
if (strlen($color) == 6)
list($r, $g, $b) = array($color[0].$color[1],
$color[2].$color[3],
$color[4].$color[5]);
elseif (strlen($color) == 3)
list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
else
return false;
$r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
return array($r, $g, $b);
}
?>
Je ne peux pas accéder aux données comme cet écho html2rgb (« # CCCCCC »); Parce que c'est un tableau
// Edit Je veux juste dire merci aux gars comment ils ont répondu. :)
Okey i ai Array ([0] => 204 [1] => 204 [2] => 204), mais comment écho chacun d'entre eux – Ben