@@ -37,53 +37,53 @@ class Color
3737 const NORMAL = 0 ;
3838
3939 // Foreground color
40- const FG_BLACK = 30 ;
41- const FG_RED = 31 ;
42- const FG_GREEN = 32 ;
43- const FG_BROWN = 33 ; // like yellow
44- const FG_BLUE = 34 ;
45- const FG_CYAN = 36 ;
46- const FG_WHITE = 37 ;
40+ const FG_BLACK = 30 ;
41+ const FG_RED = 31 ;
42+ const FG_GREEN = 32 ;
43+ const FG_BROWN = 33 ; // like yellow
44+ const FG_BLUE = 34 ;
45+ const FG_CYAN = 36 ;
46+ const FG_WHITE = 37 ;
4747 const FG_DEFAULT = 39 ;
4848
4949 // extra Foreground color
50- const FG_DARK_GRAY = 90 ;
51- const FG_LIGHT_RED = 91 ;
52- const FG_LIGHT_GREEN = 92 ;
53- const FG_LIGHT_YELLOW = 93 ;
54- const FG_LIGHT_BLUE = 94 ;
50+ const FG_DARK_GRAY = 90 ;
51+ const FG_LIGHT_RED = 91 ;
52+ const FG_LIGHT_GREEN = 92 ;
53+ const FG_LIGHT_YELLOW = 93 ;
54+ const FG_LIGHT_BLUE = 94 ;
5555 const FG_LIGHT_MAGENTA = 95 ;
56- const FG_LIGHT_CYAN = 96 ;
57- const FG_WHITE_W = 97 ;
56+ const FG_LIGHT_CYAN = 96 ;
57+ const FG_WHITE_W = 97 ;
5858
5959 // Background color
60- const BG_BLACK = 40 ;
61- const BG_RED = 41 ;
62- const BG_GREEN = 42 ;
63- const BG_BROWN = 43 ; // like yellow
64- const BG_BLUE = 44 ;
65- const BG_CYAN = 46 ;
66- const BG_WHITE = 47 ;
60+ const BG_BLACK = 40 ;
61+ const BG_RED = 41 ;
62+ const BG_GREEN = 42 ;
63+ const BG_BROWN = 43 ; // like yellow
64+ const BG_BLUE = 44 ;
65+ const BG_CYAN = 46 ;
66+ const BG_WHITE = 47 ;
6767 const BG_DEFAULT = 49 ;
6868
6969 // extra Background color
70- const BG_DARK_GRAY = 100 ;
71- const BG_LIGHT_RED = 101 ;
72- const BG_LIGHT_GREEN = 102 ;
73- const BG_LIGHT_YELLOW = 103 ;
74- const BG_LIGHT_BLUE = 104 ;
70+ const BG_DARK_GRAY = 100 ;
71+ const BG_LIGHT_RED = 101 ;
72+ const BG_LIGHT_GREEN = 102 ;
73+ const BG_LIGHT_YELLOW = 103 ;
74+ const BG_LIGHT_BLUE = 104 ;
7575 const BG_LIGHT_MAGENTA = 105 ;
76- const BG_LIGHT_CYAN = 106 ;
77- const BG_WHITE_W = 107 ;
76+ const BG_LIGHT_CYAN = 106 ;
77+ const BG_WHITE_W = 107 ;
7878
7979 // color option
80- const BOLD = 1 ; // 加粗
81- const FUZZY = 2 ; // 模糊(不是所有的终端仿真器都支持)
82- const ITALIC = 3 ; // 斜体(不是所有的终端仿真器都支持)
80+ const BOLD = 1 ; // 加粗
81+ const FUZZY = 2 ; // 模糊(不是所有的终端仿真器都支持)
82+ const ITALIC = 3 ; // 斜体(不是所有的终端仿真器都支持)
8383 const UNDERSCORE = 4 ; // 下划线
84- const BLINK = 5 ; // 闪烁
85- const REVERSE = 7 ; // 颠倒的 交换背景色与前景色
86- const CONCEALED = 8 ; // 隐匿的
84+ const BLINK = 5 ; // 闪烁
85+ const REVERSE = 7 ; // 颠倒的 交换背景色与前景色
86+ const CONCEALED = 8 ; // 隐匿的
8787
8888 /**
8989 * some styles
@@ -92,65 +92,65 @@ class Color
9292 */
9393 const STYLES = [
9494 // basic
95- 'red ' => '0;31 ' ,
96- 'blue ' => '0;34 ' ,
97- 'cyan ' => '0;36 ' ,
98- 'black ' => '0;30 ' ,
99- 'green ' => '0;32 ' ,
100- 'brown ' => '0;33 ' ,
101- 'white ' => '1;37 ' ,
102- 'normal ' => '39 ' ,// no color
103- 'yellow ' => '1;33 ' ,
104- 'magenta ' => '1;35 ' ,
95+ 'red ' => '0;31 ' ,
96+ 'blue ' => '0;34 ' ,
97+ 'cyan ' => '0;36 ' ,
98+ 'black ' => '0;30 ' ,
99+ 'green ' => '0;32 ' ,
100+ 'brown ' => '0;33 ' ,
101+ 'white ' => '1;37 ' ,
102+ 'normal ' => '39 ' ,// no color
103+ 'yellow ' => '1;33 ' ,
104+ 'magenta ' => '1;35 ' ,
105105
106106 // alert
107- 'suc ' => '1;32 ' ,// same 'green' and 'bold'
108- 'success ' => '1;32 ' ,
109- 'info ' => '0;32 ' ,// same 'green'
110- 'comment ' => '0;33 ' ,// same 'brown'
111- 'note ' => '36;1 ' ,
112- 'notice ' => '36;4 ' ,
113- 'warn ' => '0;30;43 ' ,
114- 'warning ' => '0;30;43 ' ,
115- 'danger ' => '0;31 ' ,// same 'red'
116- 'err ' => '30;41 ' ,
117- 'error ' => '30;41 ' ,
107+ 'suc ' => '1;32 ' ,// same 'green' and 'bold'
108+ 'success ' => '1;32 ' ,
109+ 'info ' => '0;32 ' ,// same 'green'
110+ 'comment ' => '0;33 ' ,// same 'brown'
111+ 'note ' => '36;1 ' ,
112+ 'notice ' => '36;4 ' ,
113+ 'warn ' => '0;30;43 ' ,
114+ 'warning ' => '0;30;43 ' ,
115+ 'danger ' => '0;31 ' ,// same 'red'
116+ 'err ' => '30;41 ' ,
117+ 'error ' => '30;41 ' ,
118118
119119 // more
120- 'lightRed ' => '1;31 ' ,
121- 'light_red ' => '1;31 ' ,
122- 'lightGreen ' => '1;32 ' ,
120+ 'lightRed ' => '1;31 ' ,
121+ 'light_red ' => '1;31 ' ,
122+ 'lightGreen ' => '1;32 ' ,
123123 'light_green ' => '1;32 ' ,
124- 'lightBlue ' => '1;34 ' ,
125- 'light_blue ' => '1;34 ' ,
126- 'lightCyan ' => '1;36 ' ,
127- 'light_cyan ' => '1;36 ' ,
128- 'lightDray ' => '37 ' ,
129- 'light_gray ' => '37 ' ,
130-
131- 'darkDray ' => '90 ' ,
132- 'dark_gray ' => '90 ' ,
133- 'lightYellow ' => '93 ' ,
134- 'light_yellow ' => '93 ' ,
135- 'lightMagenta ' => '95 ' ,
136- 'light_magenta ' => '95 ' ,
124+ 'lightBlue ' => '1;34 ' ,
125+ 'light_blue ' => '1;34 ' ,
126+ 'lightCyan ' => '1;36 ' ,
127+ 'light_cyan ' => '1;36 ' ,
128+ 'lightDray ' => '37 ' ,
129+ 'light_gray ' => '37 ' ,
130+
131+ 'darkDray ' => '90 ' ,
132+ 'dark_gray ' => '90 ' ,
133+ 'lightYellow ' => '93 ' ,
134+ 'light_yellow ' => '93 ' ,
135+ 'lightMagenta ' => '95 ' ,
136+ 'light_magenta ' => '95 ' ,
137137
138138 // extra
139- 'lightRedEx ' => '91 ' ,
140- 'light_red_ex ' => '91 ' ,
141- 'lightGreenEx ' => '92 ' ,
139+ 'lightRedEx ' => '91 ' ,
140+ 'light_red_ex ' => '91 ' ,
141+ 'lightGreenEx ' => '92 ' ,
142142 'light_green_ex ' => '92 ' ,
143- 'lightBlueEx ' => '94 ' ,
144- 'light_blue_ex ' => '94 ' ,
145- 'lightCyanEx ' => '96 ' ,
146- 'light_cyan_ex ' => '96 ' ,
147- 'whiteEx ' => '97 ' ,
148- 'white_ex ' => '97 ' ,
143+ 'lightBlueEx ' => '94 ' ,
144+ 'light_blue_ex ' => '94 ' ,
145+ 'lightCyanEx ' => '96 ' ,
146+ 'light_cyan_ex ' => '96 ' ,
147+ 'whiteEx ' => '97 ' ,
148+ 'white_ex ' => '97 ' ,
149149
150150 // option
151- 'bold ' => '1 ' ,
152- 'underscore ' => '4 ' ,
153- 'reverse ' => '7 ' ,
151+ 'bold ' => '1 ' ,
152+ 'underscore ' => '4 ' ,
153+ 'reverse ' => '7 ' ,
154154 ];
155155
156156 /**
@@ -170,7 +170,7 @@ class Color
170170
171171 /**
172172 * @param string $method
173- * @param array $args
173+ * @param array $args
174174 * @return string
175175 */
176176 public static function __callStatic ($ method , array $ args )
@@ -199,7 +199,7 @@ public static function apply(string $style, string $text): string
199199
200200 /**
201201 * render text
202- * @param string $text
202+ * @param string $text
203203 * @param string|array $style
204204 * - string: 'green', 'blue'
205205 * - array: [Color::FG_GREEN, Color::BG_WHITE, Color::UNDERSCORE]
@@ -287,7 +287,7 @@ public static function wrapTag(string $string, string $tag): string
287287
288288 /**
289289 * @param string $text
290- * @param bool $stripTag
290+ * @param bool $stripTag
291291 * @return string
292292 */
293293 public static function clearColor (string $ text , bool $ stripTag = true ): string
0 commit comments