Permalink
Browse files

Simplification des couleurs RGBA avec %

  • Loading branch information...
1 parent 2df3f71 commit 5dae8ea6a46c3f47e53a664bbb7a025d05c62c9a @NumEricR committed May 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 inc/functions.php
View
@@ -175,8 +175,9 @@ private function compress_css($css_to_compress,$lvl=0){
// Passage temporaire des codes hexa de 3 en 6 caractères (pour les conversions de couleurs)
$css_to_compress = preg_replace('#(:[^;]*\#)([a-fA-F\d])([a-fA-F\d])([a-fA-F\d])([^;]*;)#', '$1$2$2$3$3$4$4$5', $css_to_compress);
- // Conversion des codes RGB utilisant des % en valeurs chiffrées
+ // Simplification des codes RGB et RGBA utilisant des % en valeurs chiffrées
$css_to_compress = preg_replace_callback('#(:[^;]*rgb\()(\d{1,3})%[\s]*,[\s]*(\d{1,3})%[\s]*,[\s]*(\d{1,3})%(\)[^;]*;)#i', array($this, 'rgb_percent2value'), $css_to_compress);
+ $css_to_compress = preg_replace_callback('#(:[^;]*rgba\()(\d{1,3})%[\s]*,[\s]*(\d{1,3})%[\s]*,[\s]*(\d{1,3})%([\s]*,[\s]*\d(\.\d+)?\)[^;]*;)#i', array($this, 'rgb_percent2value'), $css_to_compress);
// Conversion des codes couleurs
if ($this->get_option('colors_format') != 0) {
$css_to_compress = $this->convert_colors($css_to_compress);

0 comments on commit 5dae8ea

Please sign in to comment.