File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -107,15 +107,19 @@ class Color
107107 */
108108 public const STYLES = [
109109 // basic
110+ 'normal ' => '39 ' ,// no color
110111 'red ' => '0;31 ' ,
111112 'blue ' => '0;34 ' ,
112113 'cyan ' => '0;36 ' ,
113114 'black ' => '0;30 ' ,
114115 'green ' => '0;32 ' ,
115116 'brown ' => '0;33 ' ,
116117 'white ' => '1;37 ' ,
117- 'normal ' => '39 ' , // no color
118+ 'yellow0 ' => '0;33 ' ,
118119 'yellow ' => '1;33 ' ,
120+ 'mga0 ' => '0;35 ' ,
121+ 'magenta0 ' => '0;35 ' ,
122+ 'mga ' => '1;35 ' ,
119123 'magenta ' => '1;35 ' ,
120124
121125 // alert
@@ -227,6 +231,17 @@ public static function println($messages, string $style = 'info'): void
227231 echo self ::render ($ string . "\n" , $ style );
228232 }
229233
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+
230245 /*******************************************************************************
231246 * color render
232247 ******************************************************************************/
@@ -334,7 +349,7 @@ public static function hasStyle(string $style): bool
334349 */
335350 public static function getStyles (): array
336351 {
337- return array_filter (array_keys (self ::STYLES ), function ($ style ) {
352+ return array_filter (array_keys (self ::STYLES ), static function ($ style ) {
338353 return !strpos ($ style , '_ ' );
339354 });
340355 }
You can’t perform that action at this time.
0 commit comments