Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / SUPPORTING WEFT TYPES
TerminalColorDepth
Output encodings: monochrome, 16-color ANSI, 256-color indexed, and 24-bit RGB. This type lives in weft and is not a loom typealias. Add the weft product and import weft when referring to its type name explicitly.
Defined by weft, with no loom typealias. Add the weft product to your target and use import weft when referring to this type by name.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Example
let depth: TerminalColorDepth = .ansi256
_ = Terminal(backend: ANSIBackend(), width: 80, height: 24, colorDepth: depth)Members on this page
Feature guides and release status
TerminalColorDepth
enum TerminalColorDepthConforms to: Swift.Equatable, Swift.Hashable, Swift.RawRepresentable, Swift.Sendable, Swift.SendableMetatype.
The color encodings a terminal is expected to understand.
Source · TerminalCapabilities.swift:4init(rawValue:)
init?(rawValue: String)Creates a color depth from its raw string: monochrome, ansi16, ansi256, or trueColor. Returns nil for an unrecognized string.
Parameters (1)
rawValue- Argument type and any default are shown in the declaration; see the behavior notes above.
monochrome
case monochromeEmit text attributes while omitting foreground/background color sequences.
Source · TerminalCapabilities.swift:5ansi16
case ansi16Use the basic/bright 16-color ANSI palette.
Source · TerminalCapabilities.swift:6ansi256
case ansi256Use 256 indexed palette colors; RGB values are mapped to the nearest palette color.
Source · TerminalCapabilities.swift:7trueColor
case trueColorUse explicit 24-bit red/green/blue color sequences.
Source · TerminalCapabilities.swift:8