Back to Joomla project (class list)

Class ColorStyle - list of methods

Class defining ANSI-color styles for command line output
Package: Joomla\CMS\Application\CLI
Copyright: (C) 2014 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Application/CLI/ColorStyle.php
Project: Joomla

Method Summary

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

Constructor
Parameters
  • string $fg Foreground color.
  • string $bg Background color.
  • array $options Style options.
Since
  • 4.0.0
-
  • \InvalidArgumentException
Show source code of this method: __construct Source Code

public string
()

Convert to a string.
Returns
  • string
Since
  • 4.0.0
Show source code of this method: __toString Source Code

public static $this
(string $string)

Create a color style from a parameter string.
Parameters
  • string $string The parameter string.
Returns
  • $this
Since
  • 4.0.0
-
  • \RuntimeException
Show source code of this method: fromString Source Code

public string
()

Get the translated color code.
Returns
  • string
Since
  • 4.0.0
Show source code of this method: getStyle Source Code

public string[]
()

Get the known colors.
Returns
  • string[]
Since
  • 4.0.0
Show source code of this method: getKnownColors Source Code

public string[]
()

Get the known options.
Returns
  • string[]
Since
  • 4.0.0
Show source code of this method: getKnownOptions Source Code

Properties Summary

private static array
$knownColors
Known colors
Since
  • 4.0.0
private static array
$knownOptions
Known styles
Since
  • 4.0.0
private static int
$fgBase
Foreground base value
Since
  • 4.0.0
private static int
$bgBase
Background base value
Since
  • 4.0.0
private int
$fgColor
Foreground color
Since
  • 4.0.0
private int
$bgColor
Background color
Since
  • 4.0.0
private array
$options
Array of style options
Since
  • 4.0.0

Tags Summary

Since
4.0.0
Deprecated
5.0
Use the `joomla/console` package instead