@@ -495,11 +495,11 @@ protected function shortenHexColors($content)
495495 $ content = preg_replace ('/#([0-9a-f]) \\1([0-9a-f]) \\2([0-9a-f]) \\3(?:([0-9a-f]) \\4)?/i ' , '#$1$2$3$4 ' , $ content );
496496
497497 // remove alpha channel if it's pointless ..
498- $ content = preg_replace ('/#([0-9a-f]{6})ff/i ' , '#$1 ' , $ content );
499- $ content = preg_replace ('/#([0-9a-f]{3})f(?=[ ;}\) ])/i ' , '#$1 ' , $ content );
498+ $ content = preg_replace ('/#([0-9a-f]{6})ff/i ' , '#$1 ' , $ content );
499+ $ content = preg_replace ('/#([0-9a-f]{3})f(?=[^\w ])/i ' , '#$1 ' , $ content );
500500
501- // replace `transparent` with shortcut ..
502- $ content = preg_replace ('/#[0-9a-f]{6}00/i ' , '#fff0 ' , $ content );
501+ # // replace `transparent` with shortcut ..
502+ # $content = preg_replace('/#[0-9a-f]{6}00/i', '#fff0', $content);
503503
504504 $ colors = array (
505505 // make these more readable
@@ -583,8 +583,8 @@ protected function shortenRGBColors($content)
583583 // remove alpha channel if it's pointless ..
584584 $ content = preg_replace ('/(rgb)a?\(([^,\s]+)[,\s]([^,\s]+)[,\s]([^,\s]+)\s?[,\/]\s?1(?:[\.\d]*|00%)?\)/i ' , '$1($2 $3 $4) ' , $ content );
585585
586- // replace `transparent` with shortcut ..
587- $ content = preg_replace ('/rgba?\([^,\s]+[,\s][^,\s]+[,\s][^,\s]+\s?[,\/]\s?0(?:[\.0%]*)?\)/i ' , '#fff0 ' , $ content );
586+ # // replace `transparent` with shortcut ..
587+ # $content = preg_replace('/rgba?\([^,\s]+[,\s][^,\s]+[,\s][^,\s]+\s?[,\/]\s?0(?:[\.0%]*)?\)/i', '#fff0', $content);
588588
589589 return preg_replace_callback (
590590 "/rgb\( $ dec [,\s]$ dec [,\s]$ dec\)/i " ,
@@ -614,8 +614,8 @@ protected function cleanupNEWColors($content)
614614 // remove alpha channel if it's pointless ..
615615 $ content = preg_replace ('/(hsl)a?\(([^,\s]+)[,\s]([^,\s]+)[,\s]([^,\s]+)\s?[,\/]\s?1(?:[\.\d]*|00%)?\)/i ' , '$1($2 $3 $4) ' , $ content );
616616
617- // replace `transparent` with shortcut ..
618- $ content = preg_replace ('/hsla?\([^,\s]+[,\s][^,\s]+[,\s][^,\s]+\s?[,\/]\s?0(?:[\.0%]*)?\)/i ' , '#fff0 ' , $ content );
617+ # // replace `transparent` with shortcut ..
618+ # $content = preg_replace('/hsla?\([^,\s]+[,\s][^,\s]+[,\s][^,\s]+\s?[,\/]\s?0(?:[\.0%]*)?\)/i', '#fff0', $content);
619619
620620 # ToRGB ?: https://github.com/mexitek/phpColors/blob/a74808eaf7cd918681aab0cd30f142025556bc8a/src/Mexitek/PHPColors/Color.php#L124
621621 #"/(hsl)a?\($hue[,\s]$pct[,\s]$pct[,\/]1(?:[\.\d]*|00%)?\)/i"
0 commit comments