1 /++ 2 Enum definitions of ANSI codes. 3 4 See_Also: 5 [kameloso.terminal], 6 [kameloso.terminal.colours], 7 [kameloso.terminal.colours.tags] 8 9 Copyright: [JR](https://github.com/zorael) 10 License: [Boost Software License 1.0](https://www.boost.org/users/license.html) 11 12 Authors: 13 [JR](https://github.com/zorael) 14 +/ 15 16 module kameloso.terminal.colours.defs; 17 18 19 // TerminalFormat 20 /++ 21 Format codes that work like terminal colouring does, except here for formats 22 like bold, dim, italics, etc. 23 +/ 24 enum TerminalFormat 25 { 26 unset = 0, /// Seemingly resets to nothing. 27 bold = 1, /// Bold. 28 dim = 2, /// Dim, darkens it a bit. 29 italics = 3, /// Italics; usually has some other effect. 30 underlined = 4, /// Underlined. 31 blink = 5, /// Blinking text. 32 reverse = 7, /// Inverts text foreground and background. 33 hidden = 8, /// "Hidden" text. 34 } 35 36 37 // TerminalForeground 38 /++ 39 The basic 16+1 foreground colour codes of terminal colouring. 40 +/ 41 enum TerminalForeground 42 { 43 default_ = 39, /// Default grey. 44 black = 30, /// Black. 45 red = 31, /// Red. 46 green = 32, /// Green. 47 yellow = 33, /// Yellow. 48 blue = 34, /// Blue. 49 magenta = 35, /// Magenta. 50 cyan = 36, /// Cyan. 51 lightgrey = 37, /// Light grey. 52 darkgrey = 90, /// Dark grey. 53 lightred = 91, /// Light red. 54 lightgreen = 92, /// Light green. 55 lightyellow = 93, /// Light yellow. 56 lightblue = 94, /// Light blue. 57 lightmagenta = 95, /// Light magenta. 58 lightcyan = 96, /// Light cyan. 59 white = 97, /// White. 60 } 61 62 63 // TerminalBackground 64 /++ 65 The basic 16+1 background colour codes of terminal colouring. 66 +/ 67 enum TerminalBackground 68 { 69 default_ = 49, /// Default background colour. 70 black = 40, /// Black. 71 red = 41, /// Red. 72 green = 42, /// Green. 73 yellow = 43, /// Yellow. 74 blue = 44, /// Blue. 75 magenta = 45, /// Magenta. 76 cyan = 46, /// Cyan. 77 lightgrey = 47, /// Light grey. 78 darkgrey = 100, /// Dark grey. 79 lightred = 101, /// Light red. 80 lightgreen = 102, /// Light green. 81 lightyellow = 103, /// Light yellow. 82 lightblue = 104, /// Light blue. 83 lightmagenta = 105, /// Light magenta. 84 lightcyan = 106, /// Light cyan. 85 white = 107, /// White. 86 } 87 88 89 // TerminalReset 90 /++ 91 Terminal colour/format reset codes. 92 +/ 93 enum TerminalReset 94 { 95 all = 0, /// Resets everything. 96 bright = 21, /// Resets "brighter" colours. 97 dim = 22, /// Resets "dim" colours. 98 underlined = 24, /// Resets underlined text. 99 blink = 25, /// Resets blinking text. 100 invert = 27, /// Resets inverted text. 101 hidden = 28, /// Resets hidden text. 102 } 103 104 105 // ANSICodeType 106 /++ 107 ANSI code type bitflag enum. 108 +/ 109 enum ANSICodeType 110 { 111 unset = 0, // init value. 112 foreground = 1 << 0, // Foreground colour. 113 background = 1 << 1, // Background colour. 114 format = 1 << 2, // Format token. 115 reset = 1 << 3, // Reset token. 116 }