Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe ColorStyle

Fonctions membres publiques

 __construct (string $fg='', string $bg='', array $options=[])
 
 __toString ()
 
 getStyle ()
 
 getKnownColors ()
 
 getKnownOptions ()
 

Fonctions membres publiques statiques

static fromString (string $string)
 

Attributs privés

 $fgColor = 0
 
 $bgColor = 0
 
 $options = []
 

Attributs privés statiques

static $knownColors
 
static $knownOptions
 
static $fgBase = 30
 
static $bgBase = 40
 

Description détaillée

Class defining ANSI-color styles for command line output

Depuis
4.0.0
Obsolète:
5.0 Use the joomla/console package instead

Documentation des constructeurs et destructeur

◆ __construct()

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

Constructor

Paramètres
string$fgForeground color.
string$bgBackground color.
array$optionsStyle options.
Depuis
4.0.0
Exceptions

Références $option, et $options.

Documentation des fonctions membres

◆ __toString()

__toString ( )

Convert to a string.

Renvoie
string
Depuis
4.0.0

◆ fromString()

static fromString ( string  $string)
static

Create a color style from a parameter string.

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

Paramètres
string$stringThe parameter string.
Renvoie
$this
Depuis
4.0.0
Exceptions

Références $options, et $parts.

Référencé par ColorProcessor\process().

◆ getKnownColors()

getKnownColors ( )

Get the known colors.

Renvoie
string[]
Depuis
4.0.0

◆ getKnownOptions()

getKnownOptions ( )

Get the known options.

Renvoie
string[]
Depuis
4.0.0

◆ getStyle()

getStyle ( )

Get the translated color code.

Renvoie
string
Depuis
4.0.0

Références $option.

Documentation des champs

◆ $bgBase

$bgBase = 40
staticprivate

◆ $bgColor

$bgColor = 0
private

◆ $fgBase

$fgBase = 30
staticprivate

◆ $fgColor

$fgColor = 0
private

◆ $knownColors

$knownColors
staticprivate
Valeur initiale :
= [
'black' => 0

◆ $knownOptions

$knownOptions
staticprivate
Valeur initiale :
= [
'bold' => 1

◆ $options

$options = []
private

La documentation de cette classe a été générée à partir du fichier suivant :