Voilà une petite astuce pour avoir des couleurs SPIPées avec de la transparence .
#SPIP génére des couleurs en HEX, de la forme #51f3d6 (enfin plutôt 51f3d6, le # disparaît dans les traitements)
Pour avoir des la transparence, il faut des couleurs en RGBa, du style rgba(0, 0, 255, 0.5).
▻http://www.alsacreations.com/tuto/lire/909-CSS-transparence-couleur-rgba.html
Pour cela, Il suffit de copier ce script dans mes_fonctions.php
▻http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php
function hex2rgb($hex) {
$hex = str_replace("#", “”, $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
$r = hexdec(substr($hex,0,2));
$g = hexdec(substr($hex,2,2));
$b = hexdec(substr($hex,4,2));
}
$rgb = array($r, $g, $b);
return implode(",", $rgb); // returns the rgb values separated by commas
// return $rgb; // returns an array with the rgb values
}
(notez qu’il faut décommenter dans le script original la ligne return implode et commenter le return)
Ensuite, dans son squelette on peut faire ceci :
background-color: rgba([(#LOGO_RUBRIQUE||couleur_extraire|hex2rgb)],0.3);