Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runekaagaard/php-termcolor
Colors on the command line with PHP 5+. An (almost) direct port from Python.
https://github.com/runekaagaard/php-termcolor
Last synced: 2 months ago
JSON representation
Colors on the command line with PHP 5+. An (almost) direct port from Python.
- Host: GitHub
- URL: https://github.com/runekaagaard/php-termcolor
- Owner: runekaagaard
- Created: 2011-08-05T12:22:46.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-08-10T12:38:40.000Z (over 13 years ago)
- Last Synced: 2023-03-11T21:37:31.488Z (almost 2 years ago)
- Language: PHP
- Homepage: http://pypi.python.org/pypi/termcolor
- Size: 88.9 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
## About ##
An (almost) direct port of http://pypi.python.org/pypi/termcolor to PHP. See
the phpdoc in
[termcolor.php](https://github.com/runekaagaard/php-termcolor/blob/master/termcolor.php)
for detailed documentation.## Supplied functions ##
php-termcolor provides the following functions:- `tc_colored()`: Returns text formatted with color, background color and/or
attributes.
- `tcechon()`: Echos text formatted with color, background color and/or
attributes. Adds a new line at the end.
- `tcecho()`: Echos text formatted with color, background color and/or
attributes.
The arguments for all three functions are the same. The first is the text to
be colored. Thereafter an arbitrary number of foreground colors, background
colors and text style attributes can be given. The available choices are:```
Available text colors:
red, green, yellow, blue, magenta, cyan, white.
Available text highlights:
on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan,
on_white.
Available attributes:
bold, dark, underline, blink, reverse, concealed.
```## Examples ##
```php