PHP Class Colors\Color

Afficher le fichier Open project: kevinlebrun/colors.php Class Usage Examples

Protected Properties

Свойство Type Description
$initial
$isStyleForced
$styles italic and blink may not work depending of your terminal
$userStyles
$wrapped

Méthodes publiques

Méthode Description
__call ( $method, $args )
__construct ( $string = '' )
__get ( $name )
__invoke ( $string )
__toString ( )
apply ( $style, $text = null )
are256ColorsSupported ( )
bg ( $color, $text = null )
center ( $width = 80, $text = null )
clean ( $text = null )
colorize ( $text = null )
fg ( $color, $text = null )
highlight ( $color, $text = null )
isAValidStyleName ( $name )
isStyleForced ( )
isSupported ( ) : boolean Returns true if the stream supports colorization.
reset ( )
setForceStyle ( $force )
setTheme ( array $theme )
setUserStyles ( array $userStyles )
strip ( $text = null )

Méthodes protégées

Méthode Description
applyStyle ( $style, $text )
applyUserStyle ( $userStyle, $text )
buildEscSeq ( $style )
colorizeText ( $text )
isStyleExists ( $style )
isUserStyleExists ( $style )
replaceStyle ( $matches )
setInternalState ( $string )
shouldStylize ( )
stripColors ( $text )
stylize ( $style, $text )

Method Details

__call() public méthode

public __call ( $method, $args )

__construct() public méthode

public __construct ( $string = '' )

__get() public méthode

public __get ( $name )

__invoke() public méthode

public __invoke ( $string )

__toString() public méthode

public __toString ( )

apply() public méthode

public apply ( $style, $text = null )

applyStyle() protected méthode

protected applyStyle ( $style, $text )

applyUserStyle() protected méthode

protected applyUserStyle ( $userStyle, $text )

are256ColorsSupported() public méthode

bg() public méthode

public bg ( $color, $text = null )

buildEscSeq() protected méthode

protected buildEscSeq ( $style )

center() public méthode

public center ( $width = 80, $text = null )

clean() public méthode

public clean ( $text = null )

colorize() public méthode

public colorize ( $text = null )

colorizeText() protected méthode

protected colorizeText ( $text )

fg() public méthode

public fg ( $color, $text = null )

highlight() public méthode

public highlight ( $color, $text = null )

isAValidStyleName() public méthode

public isAValidStyleName ( $name )

isStyleExists() protected méthode

protected isStyleExists ( $style )

isStyleForced() public méthode

public isStyleForced ( )

isSupported() public méthode

Colorization is disabled if not supported by the stream: - Windows without Ansicon, ConEmu or Babun - non tty consoles
public isSupported ( ) : boolean
Résultat boolean true if the stream supports colorization, false otherwise

isUserStyleExists() protected méthode

protected isUserStyleExists ( $style )

replaceStyle() protected méthode

protected replaceStyle ( $matches )

reset() public méthode

public reset ( )

setForceStyle() public méthode

public setForceStyle ( $force )

setInternalState() protected méthode

protected setInternalState ( $string )

setTheme() public méthode

Deprecation:
public setTheme ( array $theme )
$theme array

setUserStyles() public méthode

public setUserStyles ( array $userStyles )
$userStyles array

shouldStylize() protected méthode

protected shouldStylize ( )

strip() public méthode

public strip ( $text = null )

stripColors() protected méthode

protected stripColors ( $text )

stylize() protected méthode

protected stylize ( $style, $text )

Property Details

$initial protected_oe property

protected $initial

$isStyleForced protected_oe property

protected $isStyleForced

$styles protected_oe property

italic and blink may not work depending of your terminal
protected $styles

$userStyles protected_oe property

protected $userStyles

$wrapped protected_oe property

protected $wrapped