The Clico Text class allows for text decorating for the CLI stdOut.

Text and backgrounds can be coloured; text weight can be set as well as Other effects such as blinking, highlighting, and underlining.

package Default

 Methods

Constructor

__construct(String $string = null

Can optionally set the text on instantiation.

Parameters

$string

String

Renders decorated text

__toString() : string

Returns

string

Alias of heavyWeight()

b() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Affect the background

background() : \Webbtj\Clico\Text

Direct future colour methods to affect the background colour.

Returns

\Webbtj\Clico\Text

Set the colour to black

black() : \Webbtj\Clico\Text

Set the colour (background or foreground) to black

Returns

\Webbtj\Clico\Text

Set the colour to blue

blue() : \Webbtj\Clico\Text

Set the colour (background or foreground) to blue

Returns

\Webbtj\Clico\Text

Alias of heavyWeight()

bold() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Set the colour to cyan

cyan() : \Webbtj\Clico\Text

Set the colour (background or foreground) to cyan

Returns

\Webbtj\Clico\Text

Use dark colour variants

dark() : \Webbtj\Clico\Text

Make future colour assignments their dark variant

Returns

\Webbtj\Clico\Text

Make the last assigned colour dark

darken() : \Webbtj\Clico\Text

Make the most recent colour assignment (background/foreground) its dark variant.

Returns

\Webbtj\Clico\Text

Alias of lightWeight()

dim() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Alias of blink()

flash() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Affect the foreground.

foreground() : \Webbtj\Clico\Text

Direct future colour methods to affect the foreground colour.

Returns

\Webbtj\Clico\Text

Get the undecorated text value

getText() : string

Returns

string

Set the colour to green

green() : \Webbtj\Clico\Text

Set the colour (background or foreground) to green

Returns

\Webbtj\Clico\Text

Make the text bold

heavyWeight() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Make the text invisible

hidden() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Alias of hidden()

hide() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Make the text highlighted

highlight() : \Webbtj\Clico\Text

Make the text highlighted (invert background and foregroune colours)

Returns

\Webbtj\Clico\Text

Get the length of the undecorated string

length() : integer

Returns

integer

Use light colour variants

light() : \Webbtj\Clico\Text

Make future colour assignments their light variant

Returns

\Webbtj\Clico\Text

Make the text light weight/thin/dim

lightWeight() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Make the last assigned colour light

lighten() : \Webbtj\Clico\Text

Make the most recent colour assignment (background/foreground) its light variant.

Returns

\Webbtj\Clico\Text

Set the colour to magenta

magenta() : \Webbtj\Clico\Text

Set the colour (background or foreground) to magenta

Returns

\Webbtj\Clico\Text

Alias of normalWeight()

normal() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Make the text normal/default weight

normalWeight() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Experimental: Make the text multi-coloured

rainbow() : string

Returns

string

Set the colour to red

red() : \Webbtj\Clico\Text

Set the colour (background or foreground) to red

Returns

\Webbtj\Clico\Text

Repeat the text property when rendering

repeat(integer $repeat) : \Webbtj\Clico\Text

Parameters

$repeat

integer

Returns

\Webbtj\Clico\Text

Set the active colour property to its default.

setDefault(boolean $setAll = false) : \Webbtj\Clico\Text

Pass $setAll = true to set both the background and foreground colours to their default.

Parameters

$setAll

boolean

Returns

\Webbtj\Clico\Text

Alias of heavyWeight()

strong() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Experimental: Output a test pattern

testPattern(integer $width = 10) : string

Parameters

$width

integer

Returns

string

Set the (undecorated) string property

text(String $string) : \Webbtj\Clico\Text

Parameters

$string

String

Returns

\Webbtj\Clico\Text

Alias of lightWeight()

thin() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Alias of underline()

u() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Make the text underlined

underline() : \Webbtj\Clico\Text

Returns

\Webbtj\Clico\Text

Set the colour to white/grey

white() : \Webbtj\Clico\Text

Set the colour (background or foreground) to white/grey

Returns

\Webbtj\Clico\Text

Set the colour to yellow

yellow() : \Webbtj\Clico\Text

Set the colour (background or foreground) to yellow

Returns

\Webbtj\Clico\Text

Set the colour property

assignColour(integer $colour) : \Webbtj\Clico\Text

Parameters

$colour

integer

Returns

\Webbtj\Clico\Text

The index of available colours and their numeric values

colourMap() : Array

Returns

Array

 Properties

 

$BACKGROUND_OPENED

$BACKGROUND_OPENED 

Default

'background'
Static
 

$BG_DARK

$BG_DARK 

Default

40
Static
 

$BG_DEFAULT

$BG_DEFAULT 

Default

49
Static
 

$BG_LIGHT

$BG_LIGHT 

Default

100
Static
   

$DARK_SHADE

$DARK_SHADE 

Default

'dark'
Static
 

$FG_DARK

$FG_DARK 

Default

30
Static
 

$FG_DEFAULT

$FG_DEFAULT 

Default

39
Static
 

$FG_LIGHT

$FG_LIGHT 

Default

90
Static
 

$FOREGROUND_OPENED

$FOREGROUND_OPENED 

Default

'foreground'
Static
 

$HIDDEN

$HIDDEN 

Default

8
Static
 

$HIGHLIGHT

$HIGHLIGHT 

Default

7
Static
 

$LIGHT_SHADE

$LIGHT_SHADE 

Default

'light'
Static
 

$UNDERLINE

$UNDERLINE 

Default

4
Static
 

$WEIGHT_HEAVY

$WEIGHT_HEAVY 

Default

1
Static
 

$WEIGHT_LIGHT

$WEIGHT_LIGHT 

Default

2
Static
 

$WEIGHT_NORMAL

$WEIGHT_NORMAL 

Default

0
Static
 

$background

$background 

Default

   

$foreground

$foreground 

Default

 

$hidden

$hidden 

Default

 

$highlight

$highlight 

Default

 

$opened

$opened 

Default

 

$repeat

$repeat 

Default

1
 

$shade

$shade 

Default

 

$string

$string 

Default

 

$underline

$underline 

Default

 

$weight

$weight 

Default