Ejemplo n.º 1
0
 public static function replace($full_text, $search_regexp, $color)
 {
     $new_text = preg_replace_callback("/({$search_regexp})/", function ($matches) use($color) {
         return Color::set($matches[1], $color);
     }, $full_text);
     return is_null($new_text) ? $full_text : $new_text;
 }
Ejemplo n.º 2
0
 /**
  * Set the current background color
  *
  * @param  mixed   $val
  * @return boolean
  */
 public function set($val)
 {
     return parent::set($this->strip($val));
 }