-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexamples.php
71 lines (53 loc) · 2.2 KB
/
examples.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php declare(strict_types=1);
/**
* This file is part of Console Painter, a PHP Experts, Inc., Project.
*
* Copyright © 2019 PHP Experts, Inc.
* Author: Theodore R. Smith <[email protected]>
* GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
* https://www.phpexperts.pro/
* https://github.com/PHPExpertsInc/ConsolePainter
*
* This file is licensed under the MIT License.
*/
include __DIR__ . '/vendor/autoload.php';
use PHPExperts\ConsolePainter\ConsolePainter;
$painter = new ConsolePainter();
echo $painter->bold()
->underlined()
->red('Red ')
->onDarkGray('Text')
->text("\n" . 'bold + underlined + white') . "\n";
echo "New Text\n";
echo $painter->bold()
->underlined()
->red()
->onDarkGray()
->text('bold + underlined + white') . "\n";
$p = $painter;
echo $p->bold()->italics('Bold italics') . ' ' . $p->red('Bold + Red') . "\n";
echo "Normal text\n";
echo $p->black()->onLightCyan(' Black on Light Cyan ') . "\n";
echo $p->black()->onLightGreen(' Black on Light Green ') . "\n";
echo $p->white()->onGreen(' White on Green ') . "\n";
echo $p->bold()->white()->onGreen(' White on Green, Bolded ') . "\n";
echo $p->bold()->underlined()->white()->onBlue('White on Blue, Bolded + Underlined') . "\n";
echo "\n";
echo $p->onRed()->bold()->yellow(' WARNING!! WARNING!! ') . "\n\n";
/** Advanced */
echo "\t" . $p->italics('This is ') .
$p->bold('*') . $p->bold()->underlined()->yellow('*REALLY*') .
$p->bold()->onLightBlue(' emphasized*') . '!' . "\n";
echo "\n";
echo "\t" . $p->yellow('Press ')->bolder()->red('ENTER')->yellow(' to continue...') . "\n";
echo "\n";
// Draw the Red, White and Blue:
echo "\t" . $p->bolder()->red('Red')->dim(', ')->italics()->white('White ')->dim('and ')->blue('Blue') . "\n";
echo "\n";
// Draw the European Union logo:
$starField = ' ★ ★ ★ ★ ★ ';
$euroLogo = $p->text("\t")->yellow()->onBlue($starField) . "\n";
$euroLogo = $p->text((string) $euroLogo . "\t")->onBlue()
->bold()->yellow(' ★ ')->bolder()->white(' E U ')->onBlue()->yellow(' ★ ') . "\n";
$euroLogo = $p->text((string) $euroLogo . "\t")->onBlue()->yellow($starField);
echo "$euroLogo\n\n";