Enumeration
ConsoleColor
Supported colors for creating a
ConsoleStyle for ConsoleText.enum ConsoleColor
Overview
Note
Normal and bright colors are represented here separately instead of as a flag on ConsoleStyle basically because “that’s how ANSI colors work”. It’s a little conceptually weird, but so are terminal control codes.
Topics
Enumeration Cases
case blackBlackcase blueBluecase brightBlackBright blackcase brightBlueBright bluecase brightCyanBright cyancase brightGreenBright greencase brightMagentaBright magentacase brightRedBright redcase brightWhiteBright whitecase brightYellowBright yellowcase custom(r: UInt8, g: UInt8, b: UInt8)A 24-bit “true” colorcase cyanCyancase greenGreencase magentaMagentacase palette(UInt8)A color from the predefined 256-color palettecase redRedcase whiteWhitecase yellowYellow
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype
See Also
Terminal
protocol ConsoleProtocol for powering styled Console I/O.class TerminalGeneric console that uses a mixture of Swift and C standard libraries to fulfill protocol requirements.struct ConsoleStyleRepresentation of a style for outputting to a Console in different colors with differing attributes. A few suggested default styles are provided.enum ConsoleClearSupported methods for clearing theConsole.struct ConsoleTextA collection ofConsoleTextFragments. Represents stylized text that can be outputted to aConsole.struct ConsoleTextFragmentfunc + (ConsoleText, ConsoleText) -> ConsoleTextAppends aConsoleTextto anotherConsoleText.func += (inout ConsoleText, ConsoleText)Appends aConsoleTextto anotherConsoleTextin-place.extension StringProtocol