Download the PHP package localgod/console-color without Composer
On this page you can find all versions of the php package localgod/console-color. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download localgod/console-color
More information about localgod/console-color
Files in localgod/console-color
Download localgod/console-color
More information about localgod/console-color
Files in localgod/console-color
Vendor localgod
Package console-color
Short Description Tool for working with console colors
License MIT
Homepage http://localgod.github.io/console-color/
Package console-color
Short Description Tool for working with console colors
License MIT
Homepage http://localgod.github.io/console-color/
Keywords console color
Please rate this library. Is it a good library?
Informations about the package console-color
Console Color
console-color makes it simple to work with ANSI color codes in you console.
Base methods
escape($string) : Escapes % so they don't get interpreted as color codes; Takes a string as an argument and returns the escaped string.
convert($string, $colored = true)) : Transform color codes whithin supplied string into ANSI control codes
Magic methods
For each of the colors supported you can call:
- {colorname}Normal($string)
- {colorname}Bright($string)
- {colorname}Background($string)
to quickly format the string accordingly.
Code conversion table
Normal | Bright | Background | |
---|---|---|---|
Black | %k | %K | %0 |
Red | %r | %R | %1 |
Green | %g | %G | %2 |
Yellow | %y | %Y | %3 |
Blue | %b | %B | %4 |
Magenta | %m | %M | %5 |
Cyan | %c | %C | %6 |
White | %w | %W | %7 |
Code | Effect |
---|---|
%F | Blinking, Flashing |
%U | Underline |
%8 | Reverse |
%_,%9 | Bold |
%n | Resets the color |
%% | A single % |
Examples
Inspiration
This projects is a reimplementation of the ideas used in http://pear.php.net/package/Console_Color/
All versions of console-color with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
The package localgod/console-color contains the following files
Loading the files please wait ....