We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1d344d commit 11def33Copy full SHA for 11def33
1 file changed
src/Palette.php
@@ -0,0 +1,21 @@
1
+<?php
2
+namespace Gt\Cli;
3
+
4
+enum Palette:int {
5
+ case BLACK = 0;
6
+ case RED = 1;
7
+ case GREEN = 2;
8
+ case YELLOW = 3;
9
+ case BLUE = 4;
10
+ case MAGENTA = 5;
11
+ case CYAN = 6;
12
+ case WHITE = 7;
13
14
+ public function getForegroundCode():string {
15
+ return (string)(30 + $this->value);
16
+ }
17
18
+ public function getBackgroundCode():string {
19
+ return (string)(40 + $this->value);
20
21
+}
0 commit comments