File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -107,15 +107,19 @@ class Color
107
107
*/
108
108
public const STYLES = [
109
109
// basic
110
+ 'normal ' => '39 ' ,// no color
110
111
'red ' => '0;31 ' ,
111
112
'blue ' => '0;34 ' ,
112
113
'cyan ' => '0;36 ' ,
113
114
'black ' => '0;30 ' ,
114
115
'green ' => '0;32 ' ,
115
116
'brown ' => '0;33 ' ,
116
117
'white ' => '1;37 ' ,
117
- 'normal ' => '39 ' , // no color
118
+ 'yellow0 ' => '0;33 ' ,
118
119
'yellow ' => '1;33 ' ,
120
+ 'mga0 ' => '0;35 ' ,
121
+ 'magenta0 ' => '0;35 ' ,
122
+ 'mga ' => '1;35 ' ,
119
123
'magenta ' => '1;35 ' ,
120
124
121
125
// alert
@@ -227,6 +231,17 @@ public static function println($messages, string $style = 'info'): void
227
231
echo self ::render ($ string . "\n" , $ style );
228
232
}
229
233
234
+ /**
235
+ * @param string $text
236
+ * @param string $tag
237
+ *
238
+ * @return string
239
+ */
240
+ public static function addTag (string $ text , string $ tag = 'info ' ): string
241
+ {
242
+ return ColorTag::add ($ text , $ tag );
243
+ }
244
+
230
245
/*******************************************************************************
231
246
* color render
232
247
******************************************************************************/
@@ -334,7 +349,7 @@ public static function hasStyle(string $style): bool
334
349
*/
335
350
public static function getStyles (): array
336
351
{
337
- return array_filter (array_keys (self ::STYLES ), function ($ style ) {
352
+ return array_filter (array_keys (self ::STYLES ), static function ($ style ) {
338
353
return !strpos ($ style , '_ ' );
339
354
});
340
355
}
You can’t perform that action at this time.
0 commit comments