Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / RENDERING AND LAYOUT
Style
Terminal colors and bold, dim, italic, underline, strike, reverse, hidden, blink, and underline-color attributes. Concrete defaults disable attributes and use terminal colors. StylePatch supports inheritance and explicit reset. Display depends on terminal and font support.
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 style = Style(foreground: .rgb(237, 166, 98), bold: true)
_ = Paragraph(TextLayout("Hello", width: 20), style: style)Members on this page
Feature guides and release status
Style
struct StyleConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
The visual attributes applied to a terminal cell.
Source · Style.swift:37foreground
var foreground: ColorForeground text color.
Source · Style.swift:38background
var background: ColorBackground cell color.
Source · Style.swift:39bold
var bold: BoolEnables bold text.
Source · Style.swift:40italic
var italic: BoolEnables italic text.
Source · Style.swift:41underlined
var underlined: BoolEnables underline.
Source · Style.swift:42reversed
var reversed: BoolEnables reverse video.
Source · Style.swift:43dim
var dim: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · Style.swift:44strikethrough
var strikethrough: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · Style.swift:45underlineColor
var underlineColor: ColorA public field of this type. Its value type and mutability are shown in the declaration.
Source · Style.swift:46blink
var blink: BlinkA public field of this type. Its value type and mutability are shown in the declaration.
Source · Style.swift:48applying(_:)
func applying(_ patch: StylePatch) -> StyleResolves a patch over this appearance.
Unspecified attributes retain their current values.
Parameters (1)
patch- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns Style.