ConsoleColorWithForceSupport
extends ConsoleColor
Table of Contents
-
BACKGROUND
= 48
-
COLOR256_REGEXP
= '~^(bg_)?color_([0-9]{1,3})$~'
-
FOREGROUND
= 38
-
RESET_STYLE
= 0
-
$are256ColorsSupportedForce
: mixed
-
$forceStyle
: bool
-
$isSupported
: bool
-
$isSupportedForce
: mixed
-
$styles
: array<string|int, mixed>
-
$themes
: array<string|int, mixed>
-
__construct()
: mixed
-
addTheme()
: mixed
-
apply()
: string
-
are256ColorsSupported()
: bool
-
getPossibleStyles()
: array<string|int, mixed>
-
getThemes()
: array<string|int, mixed>
-
hasTheme()
: bool
-
isStyleForced()
: bool
-
isSupported()
: bool
-
removeTheme()
: mixed
-
setAre256ColorsSupported()
: mixed
-
setForceStyle()
: mixed
-
setIsSupported()
: mixed
-
setThemes()
: mixed
-
escSequence()
: string
-
isValidStyle()
: bool
-
styleSequence()
: string
-
themeSequence()
: array<string|int, string>
BACKGROUND
public
mixed
BACKGROUND
= 48
COLOR256_REGEXP
public
mixed
COLOR256_REGEXP
= '~^(bg_)?color_([0-9]{1,3})$~'
FOREGROUND
public
mixed
FOREGROUND
= 38
RESET_STYLE
public
mixed
RESET_STYLE
= 0
private
mixed
$are256ColorsSupportedForce
= rue
$forceStyle
private
bool
$forceStyle
= false
$isSupported
private
bool
$isSupported
$isSupportedForce
private
mixed
$isSupportedForce
= rue
$styles
private
array<string|int, mixed>
$styles
= array('none' => null, 'bold' => '1', 'dark' => '2', 'italic' => '3', 'underline' => '4', 'blink' => '5', 'reverse' => '7', 'concealed' => '8', 'default' => '39', 'black' => '30', 'red' => '31', 'green' => '32', 'yellow' => '33', 'blue' => '34', 'magenta' => '35', 'cyan' => '36', 'light_gray' => '37', 'dark_gray' => '90', 'light_red' => '91', 'light_green' => '92', 'light_yellow' => '93', 'light_blue' => '94', 'light_magenta' => '95', 'light_cyan' => '96', 'white' => '97', 'bg_default' => '49', 'bg_black' => '40', 'bg_red' => '41', 'bg_green' => '42', 'bg_yellow' => '43', 'bg_blue' => '44', 'bg_magenta' => '45', 'bg_cyan' => '46', 'bg_light_gray' => '47', 'bg_dark_gray' => '100', 'bg_light_red' => '101', 'bg_light_green' => '102', 'bg_light_yellow' => '103', 'bg_light_blue' => '104', 'bg_light_magenta' => '105', 'bg_light_cyan' => '106', 'bg_white' => '107')
$themes
private
array<string|int, mixed>
$themes
= array()
__construct()
public
__construct() : mixed
Return values
mixed
—
addTheme()
public
addTheme(string $name, array<string|int, mixed>|string $styles) : mixed
Parameters
-
$name
: string
-
-
$styles
: array<string|int, mixed>|string
-
-
throws
-
InvalidArgumentException
-
throws
-
InvalidStyleException
Return values
mixed
—
apply()
public
apply(string|array<string|int, mixed> $style, string $text) : string
Parameters
-
$style
: string|array<string|int, mixed>
-
-
$text
: string
-
-
throws
-
InvalidStyleException
-
throws
-
InvalidArgumentException
Return values
string
—
public
are256ColorsSupported() : bool
Return values
bool
—
getPossibleStyles()
public
getPossibleStyles() : array<string|int, mixed>
Return values
array<string|int, mixed>
—
getThemes()
public
getThemes() : array<string|int, mixed>
Return values
array<string|int, mixed>
—
hasTheme()
public
hasTheme(string $name) : bool
Parameters
-
$name
: string
-
Return values
bool
—
isStyleForced()
public
isStyleForced() : bool
Return values
bool
—
isSupported()
public
isSupported() : bool
Return values
bool
—
removeTheme()
public
removeTheme(string $name) : mixed
Parameters
-
$name
: string
-
Return values
mixed
—
public
setAre256ColorsSupported(mixed $are256ColorsSupported) : mixed
Parameters
-
$are256ColorsSupported
: mixed
-
Return values
mixed
—
setForceStyle()
public
setForceStyle(bool $forceStyle) : mixed
Parameters
-
$forceStyle
: bool
-
Return values
mixed
—
setIsSupported()
public
setIsSupported(mixed $isSupported) : mixed
Parameters
-
$isSupported
: mixed
-
Return values
mixed
—
setThemes()
public
setThemes(array<string|int, mixed> $themes) : mixed
Parameters
-
$themes
: array<string|int, mixed>
-
-
throws
-
InvalidStyleException
-
throws
-
InvalidArgumentException
Return values
mixed
—
escSequence()
private
escSequence(string|int $value) : string
Parameters
-
$value
: string|int
-
Return values
string
—
isValidStyle()
private
isValidStyle(string $style) : bool
Parameters
-
$style
: string
-
Return values
bool
—
styleSequence()
private
styleSequence(string $style) : string
Parameters
-
$style
: string
-
Return values
string
—
themeSequence()
private
themeSequence(string $name) : array<string|int, string>
Parameters
-
$name
: string
-
Return values
array<string|int, string>
—