eznio/styler

Simple CLI styling helper

1.1.1 2017-06-09 23:06 UTC

This package is not auto-updated.

Last update: 2024-11-23 21:04:24 UTC


README

Overview

Simple CLI styling helper. Generates ASCII sequences to change console bg/fg-colors and some text effects

echo Styler::get(Styles::HYPERLINK) . 'this looks like a link' . Styler::reset() . "\n";

echo Styler::get([
    BackgroundColors::WHITE,
    ForegroundColors::BLUE,
    TestStyles::UNDERLINE
]) . 'this looks like a link too!' . Styler::reset() . "\n";

Reference

Styler::get(array $style)

Returns sequence for given style(-s). Preferred one.

Styler::single($style)

Returns sequence for single given style

Styler::combined(array $styles)

Returns sequence for multiple given styles

Styler::reset()

Returns reset sequence (return to console default colors)

Style reference files

  • ForegroundColors - foreground colors list
  • BackgroundColors - background colors list
  • TextStyles - list of text styles. Some of them may be not supported by your console!
  • StyleSets - some useful (sometimes) shortcuts