$text = Colors::colorize('hello world', Colors::RED)
$text = Colors::colorize('hello world', 'red')
$text = Colors::colorize('hello world', Colors::RED | Colors::BOLD)
$text = Colors::colorize('hello world', 'red+bold')
$text = Colors::red('hello world');
Afficher le fichier
Open project: maximebf/consolekit
Class Usage Examples
Méthode | Description | |
---|---|---|
__callStatic ( $method, $args ) | ||
colorize ( string $text, string $fgcolor = null, string $bgcolor = null ) : string | Returns a colorized string | |
colorizeLines ( string $text, string $fgcolor = null, string $bgcolor = null ) : string | Returns a text with each lines colorized independently | |
getBgColorString ( $colorCode ) : string | Returns a background color string | |
getColorCode ( integer | string $color, array $options = [] ) : integer | Returns a color code | |
getFgColorString ( $colorCode ) : string | Returns a foreground color string |
Méthode | Description | |
---|---|---|
extractColorAndOptions ( integer $colorCode ) : array | Extracts the options and the color from a color code |
public static getBgColorString ( $colorCode ) : string | ||
Résultat | string |
public static getFgColorString ( $colorCode ) : string | ||
Résultat | string |