Skip to content

Commit 0bb1d31

Browse files
committed
Put factory color functions back
1 parent f852324 commit 0bb1d31

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/Output/Color.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,46 @@ class Color
7474
'warn' => ['fg' => 33],
7575
];
7676

77+
/**
78+
* Returns a line formatted as comment.
79+
*/
80+
public function comment(string $text, array $style = []): string
81+
{
82+
return $this->line($text, static::$styles['comment'] + $style);
83+
}
84+
85+
/**
86+
* Returns a line formatted as comment.
87+
*/
88+
public function error(string $text, array $style = []): string
89+
{
90+
return $this->line($text, static::$styles['error'] + $style);
91+
}
92+
93+
/**
94+
* Returns a line formatted as ok msg.
95+
*/
96+
public function ok(string $text, array $style = []): string
97+
{
98+
return $this->line($text, static::$styles['ok'] + $style);
99+
}
100+
101+
/**
102+
* Returns a line formatted as warning.
103+
*/
104+
public function warn(string $text, array $style = []): string
105+
{
106+
return $this->line($text, static::$styles['warn'] + $style);
107+
}
108+
109+
/**
110+
* Returns a line formatted as info.
111+
*/
112+
public function info(string $text, array $style = []): string
113+
{
114+
return $this->line($text, static::$styles['info'] + $style);
115+
}
116+
77117
/**
78118
* Returns the color code for a 256 background color.
79119
*/

0 commit comments

Comments
 (0)