Overview

Namespaces

  • Webmozart
    • Console
      • Adapter
      • Api
        • Application
        • Args
          • Format
        • Command
        • Config
        • Event
        • Formatter
        • IO
        • Resolver
      • Args
      • Config
      • Formatter
      • Handler
        • Help
      • IO
        • InputStream
        • OutputStream
      • Process
      • Resolver
      • UI
        • Alignment
        • Component
        • Help
        • Layout
        • Style
      • Util

Classes

  • Style
  • StyleSet

Interfaces

  • Formatter
  • Overview
  • Namespace
  • Class

Class Style

A formatter style.

Namespace: Webmozart\Console\Api\Formatter
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
Located at Api/Formatter/Style.php
Methods summary
public static static
# tag( string $tag )

Creates a style with the given tag name.

Creates a style with the given tag name.

Parameters

$tag
The tag name.

Returns

static
The created style.

See

Webmozart\Console\Api\Formatter\Style::noTag()
public static static
# noTag( )

Creates a style without a tag name.

Creates a style without a tag name.

Returns

static
The created style.

See

Webmozart\Console\Api\Formatter\Style::tag()
public
# __construct( string $tag = null )

Creates a style.

Creates a style.

Parameters

$tag
The tag name.
public static
# fg( string $color )

Sets the foreground color.

Sets the foreground color.

Parameters

$color
One of the color constants.

Returns

static
The current instance.
public static
# fgDefault( )

Resets the foreground color to the system's default.

Resets the foreground color to the system's default.

Returns

static
The current instance.
public static
# fgBlack( )

Sets the foreground color to black.

Sets the foreground color to black.

Returns

static
The current instance.
public static
# fgRed( )

Sets the foreground color to red.

Sets the foreground color to red.

Returns

static
The current instance.
public static
# fgGreen( )

Sets the foreground color to green.

Sets the foreground color to green.

Returns

static
The current instance.
public static
# fgYellow( )

Sets the foreground color to yellow.

Sets the foreground color to yellow.

Returns

static
The current instance.
public static
# fgBlue( )

Sets the foreground color to blue.

Sets the foreground color to blue.

Returns

static
The current instance.
public static
# fgMagenta( )

Sets the foreground color to magenta.

Sets the foreground color to magenta.

Returns

static
The current instance.
public static
# fgCyan( )

Sets the foreground color to cyan.

Sets the foreground color to cyan.

Returns

static
The current instance.
public static
# fgWhite( )

Sets the foreground color to white.

Sets the foreground color to white.

Returns

static
The current instance.
public static
# bg( string $color )

Sets the background color.

Sets the background color.

Parameters

$color
One of the color constants.

Returns

static
The current instance.
public static
# bgDefault( )

Resets the background color to the system's default.

Resets the background color to the system's default.

Returns

static
The current instance.
public static
# bgBlack( )

Sets the background color to black.

Sets the background color to black.

Returns

static
The current instance.
public static
# bgRed( )

Sets the background color to red.

Sets the background color to red.

Returns

static
The current instance.
public static
# bgGreen( )

Sets the background color to green.

Sets the background color to green.

Returns

static
The current instance.
public static
# bgYellow( )

Sets the background color to yellow.

Sets the background color to yellow.

Returns

static
The current instance.
public static
# bgBlue( )

Sets the background color to blue.

Sets the background color to blue.

Returns

static
The current instance.
public static
# bgMagenta( )

Sets the background color to magenta.

Sets the background color to magenta.

Returns

static
The current instance.
public static
# bgCyan( )

Sets the background color to cyan.

Sets the background color to cyan.

Returns

static
The current instance.
public static
# bgWhite( )

Sets the background color to white.

Sets the background color to white.

Returns

static
The current instance.
public static
# bold( )

Sets the font weight to bold.

Sets the font weight to bold.

Returns

static
The current instance.
public static
# notBold( )

Sets the font weight to normal.

Sets the font weight to normal.

Returns

static
The current instance.
public static
# underlined( )

Enables underlining.

Enables underlining.

Returns

static
The current instance.
public static
# notUnderlined( )

Disables underlining.

Disables underlining.

Returns

static
The current instance.
public static
# blinking( )

Enables blinking.

Enables blinking.

Returns

static
The current instance.
public static
# notBlinking( )

Disables blinking.

Disables blinking.

Returns

static
The current instance.
public static
# inverse( )

Enables inverse colors.

Enables inverse colors.

Returns

static
The current instance.
public static
# notInverse( )

Disables inverse colors.

Disables inverse colors.

Returns

static
The current instance.
public static
# hidden( )

Hides the text.

Hides the text.

Returns

static
The current instance.
public static
# notHidden( )

Does not hide the text.

Does not hide the text.

Returns

static
The current instance.
public string
# getTag( )

Returns the style's tag name.

Returns the style's tag name.

Returns

string
The tag name or null if the style has no tag.
public string
# getForegroundColor( )

Returns the foreground color.

Returns the foreground color.

Returns

string

One of the color constants or null if the system's default should be used.

public string
# getBackgroundColor( )

Returns the background color.

Returns the background color.

Returns

string

One of the color constants or null if the system's default should be used.

public boolean
# isBold( )

Returns whether the text is bold.

Returns whether the text is bold.

Returns

boolean

Returns true if text is formatted bold and false otherwise.

public boolean
# isUnderlined( )

Returns whether the text is underlined.

Returns whether the text is underlined.

Returns

boolean

Returns true if text is formatted underlined and false otherwise.

public boolean
# isBlinking( )

Returns whether the text is blinking.

Returns whether the text is blinking.

Returns

boolean

Returns true if text is formatted blinking and false otherwise.

public boolean
# isInverse( )

Returns whether the text is reversed.

Returns whether the text is reversed.

Returns

boolean

Returns true if text is formatted reversed and false otherwise.

public boolean
# isHidden( )

Returns whether the text is concealed.

Returns whether the text is concealed.

Returns

boolean

Returns true if text is formatted concealed and false otherwise.

Constants summary
string BLACK

Color: black.

Color: black.

# 'black'
string RED

Color: red.

Color: red.

# 'red'
string GREEN

Color: green.

Color: green.

# 'green'
string YELLOW

Color: yellow.

Color: yellow.

# 'yellow'
string BLUE

Color: blue.

Color: blue.

# 'blue'
string MAGENTA

Color: magenta.

Color: magenta.

# 'magenta'
string CYAN

Color: cyan.

Color: cyan.

# 'cyan'
string WHITE

Color: white.

Color: white.

# 'white'
Webmozart Console API API documentation generated by ApiGen