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; }
/** * Set the current background color * * @param mixed $val * @return boolean */ public function set($val) { return parent::set($this->strip($val)); }