ColorStyle

Class ColorStyle

final deprecated
since

1.0

deprecated

2.0 Use the joomla/console package instead

Methods

__construct

Constructor

__construct(string $fg = '', string $bg = '', array $options = array()) 
since

1.0

throws

\InvalidArgumentException

Arguments

$fg

stringForeground color.

$bg

stringBackground color.

$options

arrayStyle options.

__toString

Convert to a string.

__toString() : string
since

1.0

Response

string

fromString

Create a color style from a parameter string.

fromString(string $string) : \Joomla\Application\Cli\ColorStyle
static

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

since

1.0

throws

\RuntimeException

Arguments

$string

stringThe parameter string.

Response

\Joomla\Application\Cli\ColorStyleInstance of $this to allow chaining.

getKnownColors

Get the known colors.

getKnownColors() : string
since

1.0

Response

string

getKnownOptions

Get the known options.

getKnownOptions() : array
since

1.0

Response

array

getStyle

Get the translated color code.

getStyle() : string
since

1.0

Response

string

Properties

knownColors

Known colors

static
since

1.0

Type(s)

array

knownOptions

Known styles

static
since

1.0

Type(s)

array

fgBase

Foreground base value

static
since

1.0

Type(s)

integer

bgBase

Background base value

static
since

1.0

Type(s)

integer

fgColor

Foreground color

since

1.0

Type(s)

integer

bgColor

Background color

since

1.0

Type(s)

integer

options

Array of style options

since

1.0

Type(s)

array