Color
in package
FinalYes
Tags
Table of Contents
Constants
- AVAILABLE_OPTIONS = ['bold' => ['set' => 1, 'unset' => 22], 'underscore' => ['set' => 4, 'unset' => 24], 'blink' => ['set' => 5, 'unset' => 25], 'reverse' => ['set' => 7, 'unset' => 27], 'conceal' => ['set' => 8, 'unset' => 28]]
- BRIGHT_COLORS = ['gray' => 0, 'bright-red' => 1, 'bright-green' => 2, 'bright-yellow' => 3, 'bright-blue' => 4, 'bright-magenta' => 5, 'bright-cyan' => 6, 'bright-white' => 7]
- COLORS = ['black' => 0, 'red' => 1, 'green' => 2, 'yellow' => 3, 'blue' => 4, 'magenta' => 5, 'cyan' => 6, 'white' => 7, 'default' => 9]
Properties
- $background : string
- $foreground : string
- $options : array<string|int, mixed>
Methods
- __construct() : mixed
- apply() : string
- set() : string
- unset() : string
- parseColor() : string
Constants
AVAILABLE_OPTIONS
private
mixed
AVAILABLE_OPTIONS
= ['bold' => ['set' => 1, 'unset' => 22], 'underscore' => ['set' => 4, 'unset' => 24], 'blink' => ['set' => 5, 'unset' => 25], 'reverse' => ['set' => 7, 'unset' => 27], 'conceal' => ['set' => 8, 'unset' => 28]]
BRIGHT_COLORS
private
mixed
BRIGHT_COLORS
= ['gray' => 0, 'bright-red' => 1, 'bright-green' => 2, 'bright-yellow' => 3, 'bright-blue' => 4, 'bright-magenta' => 5, 'bright-cyan' => 6, 'bright-white' => 7]
COLORS
private
mixed
COLORS
= ['black' => 0, 'red' => 1, 'green' => 2, 'yellow' => 3, 'blue' => 4, 'magenta' => 5, 'cyan' => 6, 'white' => 7, 'default' => 9]
Properties
$background
private
string
$background
$foreground
private
string
$foreground
$options
private
array<string|int, mixed>
$options
= []
Methods
__construct()
public
__construct([string $foreground = '' ][, string $background = '' ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $foreground : string = ''
- $background : string = ''
- $options : array<string|int, mixed> = []
apply()
public
apply(string $text) : string
Parameters
- $text : string
Return values
stringset()
public
set() : string
Return values
stringunset()
public
unset() : string
Return values
stringparseColor()
private
parseColor(string $color[, bool $background = false ]) : string
Parameters
- $color : string
- $background : bool = false