1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract;
4:
5: /**
6: * @api
7: */
8: interface HasEscapeSequence
9: {
10: public const BLACK_FG = "\e[30m";
11: public const RED_FG = "\e[31m";
12: public const GREEN_FG = "\e[32m";
13: public const YELLOW_FG = "\e[33m";
14: public const BLUE_FG = "\e[34m";
15: public const MAGENTA_FG = "\e[35m";
16: public const CYAN_FG = "\e[36m";
17: public const WHITE_FG = "\e[37m";
18: public const DEFAULT_FG = "\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 FAINT = "\e[2m";
30: public const BOLD_NOT_FAINT = "\e[22;1m";
31: public const FAINT_NOT_BOLD = "\e[22;2m";
32: public const NOT_BOLD_NOT_FAINT = "\e[22m";
33: public const UNDERLINED = "\e[4m";
34: public const NOT_UNDERLINED = "\e[24m";
35:
36: /**
37: * Reset colours and style
38: *
39: * From \[ECMA-48] 8.3.117 (SELECT GRAPHIC RENDITION): "cancels the effect
40: * of any preceding occurrence of SGR in the data stream".
41: */
42: public const RESET = "\e[m";
43:
44: /**
45: * Clear to end of line
46: *
47: * From \[ECMA-48] 8.3.41 (ERASE IN LINE): "the active presentation position
48: * and the character positions up to the end of the line are put into the
49: * erased state".
50: */
51: public const CLEAR_LINE = "\e[K";
52:
53: /**
54: * Disable auto-wrap mode (DECAWM)
55: */
56: public const NO_AUTO_WRAP = "\e[?7l";
57:
58: /**
59: * Enable auto-wrap mode (DECAWM)
60: */
61: public const AUTO_WRAP = "\e[?7h";
62: }
63: