-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrainbow.php
37 lines (32 loc) · 908 Bytes
/
rainbow.php
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
32
33
34
35
36
37
<?php
use Codedungeon\PHPCliColors\Color;
require __DIR__ . '/src/Color.php';
$colors = [
'white',
'red',
'blue',
'green',
'cyan',
'yellow',
'magenta',
'gray',
'purple',
];
foreach ($colors as $colorItem) {
$method = $colorItem;
$bold_method = 'bold_' . $colorItem;
$light_method = 'light_' . $colorItem;
$bg_method = 'bg_' . $colorItem;
echo Color::$method() . "Regular {$colorItem}, "
. Color::reset()
. Color::$bold_method() . "Bold {$colorItem}, "
. Color::reset()
. Color::$light_method() . "Light {$colorItem}, "
. Color::reset()
. Color::$bg_method() . "Background {$colorItem}, "
. Color::reset()
. Color::$bg_method(true) . "Bold White on Background {$colorItem}, "
. Color::black() . "Black on Background {$colorItem}"
. Color::reset()
. PHP_EOL;
}