Skip to content

Commit

Permalink
Add format() for setting both back and front.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Apr 19, 2017
1 parent aca550f commit 367f8c3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions framework/Cli/lib/Horde/Cli/Color.php
Expand Up @@ -191,6 +191,20 @@ public function background($color, $text)
return $text;
}

/**
* Returns a version of $text with a colored foreground and background.
*
* @param string $foreground The foreground color to use.
* @param string $background The background color to use.
* @param string $text The text to print in color.
*
* @return string The colored text.
*/
public function format($foreground, $background, $text)
{
return $this->background($background, $this->color($foreground, $text));
}

/**
* Removes all color formatting from a text.
*
Expand Down

0 comments on commit 367f8c3

Please sign in to comment.