$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');
파일 보기
프로젝트 열기: maximebf/consolekit
1 사용 예제들
메소드 | 설명 | |
---|---|---|
__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 |
메소드 | 설명 | |
---|---|---|
extractColorAndOptions ( integer $colorCode ) : array | Extracts the options and the color from a color code |
public static getBgColorString ( $colorCode ) : string | ||
리턴 | string |
public static getFgColorString ( $colorCode ) : string | ||
리턴 | string |