-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathColor.php
More file actions
96 lines (86 loc) · 1.88 KB
/
Copy pathColor.php
File metadata and controls
96 lines (86 loc) · 1.88 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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
declare(strict_types=1);
namespace Bow\Console;
class Color
{
/**
* Red message with '[danger]' prefix
*
* @param string $message
* @return string
*/
public static function danger(string $message): string
{
return static::red('[danger]') . ' ' . $message;
}
/**
* Red message
*
* @param string $message
* @return string
*/
public static function red(string $message): string
{
return "\033[0;31m$message\033[00m";
}
/**
* Blue message with '[info]' prefix
*
* @param string $message
* @return string
*/
public static function info(string $message): string
{
return static::blue('[info]') . ' ' . $message;
}
/**
* Blue message
*
* @param string $message
* @return string
*/
public static function blue(string $message): string
{
return "\033[0;30m$message\033[00m";
}
/**
* Yellow message with '[warning]' prefix
*
* @param string $message
* @return string
*/
public static function warning(string $message): string
{
return static::yellow('[warning]') . ' ' . $message;
}
/**
* Yellow message
*
* @param string $message
* @return string
*/
public static function yellow(string $message): string
{
return "\033[0;33m$message\033[00m";
}
/**
* Green message with '[success]' prefix
*
* @param string $message
* @return string
*/
public static function success(string $message): string
{
return static::green('[success]') . ' ' . $message;
}
/**
* Green message
*
* @param string $message
* @return string
*/
public static function green(string $message): string
{
return "\033[0;32m$message\033[00m";
}
}