private mixed
replaceColors
(mixed $text, mixed $tag, mixed $match, \Joomla\CMS\Application\CLI\ColorStyle $style)
/**
* Replace color tags in a string.
*
* @param string $text The original text.
* @param string $tag The matched tag.
* @param string $match The match.
* @param ColorStyle $style The color style to apply.
*
* @return mixed
*
* @since 4.0.0
*/
private function replaceColors($text, $tag, $match, ColorStyle $style)
{
$replace = $this->noColors ? $match : "\x1b[" . $style . 'm' . $match . "\x1b[0m";
return str_replace('<' . $tag . '>' . $match . '</' . $tag . '>', $replace, $text);
}