1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Core;
4:
5: /**
6: * ANSI escape sequences for formatting terminal output
7: */
8: interface EscapeSequence
9: {
10: public const BLACK = "\e[30m";
11: public const RED = "\e[31m";
12: public const GREEN = "\e[32m";
13: public const YELLOW = "\e[33m";
14: public const BLUE = "\e[34m";
15: public const MAGENTA = "\e[35m";
16: public const CYAN = "\e[36m";
17: public const WHITE = "\e[37m";
18: public const DEFAULT = "\e[39m";
19: public const BLACK_BG = "\e[40m";
20: public const RED_BG = "\e[41m";
21: public const GREEN_BG = "\e[42m";
22: public const YELLOW_BG = "\e[43m";
23: public const BLUE_BG = "\e[44m";
24: public const MAGENTA_BG = "\e[45m";
25: public const CYAN_BG = "\e[46m";
26: public const WHITE_BG = "\e[47m";
27: public const DEFAULT_BG = "\e[49m";
28: public const BOLD = "\e[1m";
29: public const DIM = "\e[2m";
30: public const UNDERLINE = "\e[4m";
31: public const NO_UNDERLINE = "\e[24m";
32:
33: /**
34: * Reset BOLD and DIM
35: *
36: * @see EscapeSequence::UNBOLD_DIM
37: * @see EscapeSequence::UNDIM_BOLD
38: */
39: public const UNBOLD_UNDIM = "\e[22m";
40:
41: /**
42: * Reset BOLD, set DIM
43: */
44: public const UNBOLD_DIM = "\e[22;2m";
45:
46: /**
47: * Reset DIM, set BOLD
48: */
49: public const UNDIM_BOLD = "\e[22;1m";
50:
51: /**
52: * Reset all colours and styles
53: */
54: public const RESET = "\e[m";
55:
56: /**
57: * Clear to end of line
58: */
59: public const CLEAR_LINE = "\e[K";
60:
61: /**
62: * Turn off automatic margins
63: */
64: public const WRAP_OFF = "\e[?7l";
65:
66: /**
67: * Turn on automatic margins
68: */
69: public const WRAP_ON = "\e[?7h";
70: }
71: