Skip to content

Commit

Permalink
Put factory color functions back
Browse files Browse the repository at this point in the history
  • Loading branch information
kodie committed Nov 26, 2024
1 parent 57d1bbf commit cab2dd7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/Output/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,46 @@ class Color
'warn' => ['fg' => 33],
];

/**
* Returns a line formatted as comment.
*/
public function comment(string $text, array $style = []): string
{
return $this->line($text, static::$styles['comment'] + $style);
}

/**
* Returns a line formatted as comment.
*/
public function error(string $text, array $style = []): string
{
return $this->line($text, static::$styles['error'] + $style);
}

/**
* Returns a line formatted as ok msg.
*/
public function ok(string $text, array $style = []): string
{
return $this->line($text, static::$styles['ok'] + $style);
}

/**
* Returns a line formatted as warning.
*/
public function warn(string $text, array $style = []): string
{
return $this->line($text, static::$styles['warn'] + $style);
}

/**
* Returns a line formatted as info.
*/
public function info(string $text, array $style = []): string
{
return $this->line($text, static::$styles['info'] + $style);
}

/**
* Returns a formatted/colored line.
*/
Expand Down

0 comments on commit cab2dd7

Please sign in to comment.