Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mogria/colorful.php
This tiny PHP Library provides a class to decorate text with ANSI terminal colors and modifiers.
https://github.com/mogria/colorful.php
Last synced: 7 days ago
JSON representation
This tiny PHP Library provides a class to decorate text with ANSI terminal colors and modifiers.
- Host: GitHub
- URL: https://github.com/mogria/colorful.php
- Owner: mogria
- License: gpl-3.0
- Created: 2012-04-18T20:32:20.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-04-18T20:32:41.000Z (over 12 years ago)
- Last Synced: 2024-10-12T00:26:48.735Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 97.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# colorful.php
This tiny PHP Library provides a class to decorate text with ANSI terminal colors and modifiers. It's a PHP implementation of [this project](https://github.com/timofurrer/colorful) .***
**Author:** Mogria (Thanks to Timo Furrer for the awesome python module)
**License:** GPLv3 (See `LICENSE`)# dafuq?
With this Library you can decorate some text with colors and other awesome stuff.
For example:
print(cf::bold_red_on_black("dfgdfg"));
print(cf::black_on_white("Hello World!"));
print(cf::underline("Hello World!"));
print(cf::bold_and_underline_green("Hello World!"));
print(cf::bold_and_underline_green_on_red("Hello World!"));
print(cf::bold_and_underline_and_strikethrough_green_on_red("Hello World!"));
print(cf::strikethrough("dfgsfdg"));Or if you want to output it directly:
cf_out::bold_red_on_black("dfgdfg");
cf_out::black_on_white("Hello World!");
cf_out::underline("Hello World!");
...## Available modifiers and colors
### Modifiers:
* reset
* bold
* italic
* underline
* blink
* inverse
* strikethrough### Forecolors:
* black
* red
* green
* brown
* blue
* magenta
* cyan
* white
* normal### Backcolors:
* black
* red
* green
* yellow
* blue
* magenta
* cyan
* white
* normal