ColorStyle

Class defining ANSI-color styles for command line output

final deprecated
since

4.0.0

deprecated

5.0 Use the joomla/console package instead

package

Application

Methods

__construct

Constructor

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

4.0.0

throws

\InvalidArgumentException

Arguments

fg

stringForeground color.

bg

stringBackground color.

options

arrayStyle options.

Response

mixed

__toString

Convert to a string.

__toString() : string
since

4.0.0

Response

string

fromString

Create a color style from a parameter string.

fromString(string string) : $this
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[]
since

4.0.0

Response

string[]

getKnownOptions

Get the known options.

getKnownOptions() : string[]
since

4.0.0

Response

string[]

getStyle

Get the translated color code.

getStyle() : string
since

4.0.0

Response

string

Properties

knownColors

Known colors

static
since

4.0.0

Type(s)

array

knownOptions

Known styles

static
since

4.0.0

Type(s)

array

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