ColorStyle

Class defining ANSI-color styles for command line output

final deprecated
since

4.0.0

deprecated

4.3 will be removed in 6.0 Use the joomla/console package instead

package

Joomla CMS

Methods

__construct

Constructor

__construct( fg = '',  bg = '', mixed||string|int options = []) : 
since

4.0.0

throws

InvalidArgumentException

Arguments

fg

stringForeground color.

bg

stringBackground color.

options

array<string|int, mixed>Style options.

Response

mixed

__toString

Convert to a string.

__toString() : 
since

4.0.0

Response

string

fromString

Create a color style from a parameter string.

fromString( string) : 
static

Example: fg=red;bg=blue;options=bold,blink

since

4.0.0

throws

RuntimeException

Arguments

string

stringThe parameter string.

Response

$this

getKnownColors

Get the known colors.

getKnownColors() : string||string|int
since

4.0.0

Response

array<string|int, string>

getKnownOptions

Get the known options.

getKnownOptions() : string||string|int
since

4.0.0

Response

array<string|int, string>

getStyle

Get the translated color code.

getStyle() : 
since

4.0.0

Response

string

Properties

knownColors

Known colors

static
since

4.0.0

Type(s)

array<string|int, mixed>

knownOptions

Known styles

static
since

4.0.0

Type(s)

array<string|int, mixed>

fgBase

Foreground base value

static
since

4.0.0

Type(s)

int

bgBase

Background base value

static
since

4.0.0

Type(s)

int

fgColor

Foreground color

since

4.0.0

Type(s)

int

bgColor

Background color

since

4.0.0

Type(s)

int

options

Array of style options

since

4.0.0

Type(s)

array<string|int, mixed>