-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathcolors.php
More file actions
32 lines (26 loc) · 1.71 KB
/
colors.php
File metadata and controls
32 lines (26 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
// Samples. Lines marked with * should be colored in output
// php examples/colors.php
// * All output is run through \cli\Colors::colorize before display
// * All output is run through \cli\Colors::colorize before display
// * All output is run through \cli\Colors::colorize before display
// * All output is run through \cli\Colors::colorize before display
// All output is run through \cli\Colors::colorize before display
// * All output is run through \cli\Colors::colorize before display
// php examples/colors.php | cat
// All output is run through \cli\Colors::colorize before display
// * All output is run through \cli\Colors::colorize before display
// All output is run through \cli\Colors::colorize before display
// * All output is run through \cli\Colors::colorize before display
// All output is run through \cli\Colors::colorize before display
// All output is run through \cli\Colors::colorize before display
require_once 'common.php';
\cli\line(' %C%5All output is run through %Y%6\cli\Colors::colorize%C%5 before display%n');
echo \cli\Colors::colorize(' %C%5All output is run through %Y%6\cli\Colors::colorize%C%5 before display%n', true) . "\n";
echo \cli\Colors::colorize(' %C%5All output is run through %Y%6\cli\Colors::colorize%C%5 before display%n') . "\n";
\cli\Colors::enable(); // Forcefully enable
\cli\line(' %C%5All output is run through %Y%6\cli\Colors::colorize%C%5 before display%n');
\cli\Colors::disable(); // Disable forcefully!
\cli\line(' %C%5All output is run through %Y%6\cli\Colors::colorize%C%5 before display%n', true);
\cli\Colors::enable(false); // Enable, but not forcefully
\cli\line(' %C%5All output is run through %Y%6\cli\Colors::colorize%C%5 before display%n');