Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / RENDERING, VIEWPORTS, AND COMPOSITION
StylePatch
Optional appearance changes composed over a resolved Style.
Nil inherits the existing attribute. A false modifier explicitly disables it;
.terminalDefault explicitly resets a color. Use Blink.none to disable blinking
(nil or optional .none inherits it). For example,
Style(foreground: .indexed(4)).applying(StylePatch(bold: true)) retains blue.
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
_ = Style(bold: true).applying(StylePatch(bold: false, italic: true))Members on this page
Feature guides and release status
StylePatch
struct StylePatchConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
Optional appearance changes composed over a resolved Style.
Nil inherits the existing attribute. A false modifier explicitly disables it;
.terminalDefault explicitly resets a color. Use Blink.none to disable blinking
(nil or optional .none inherits it). For example,
Style(foreground: .indexed(4)).applying(StylePatch(bold: true)) retains blue.
foreground
var foreground: Color?Foreground text color.
Source · StylePatch.swift:8background
var background: Color?Background cell color.
Source · StylePatch.swift:9bold
var bold: Bool?Enables bold text.
Source · StylePatch.swift:10italic
var italic: Bool?Enables italic text.
Source · StylePatch.swift:11underlined
var underlined: Bool?Enables underline.
Source · StylePatch.swift:12reversed
var reversed: Bool?Enables reverse video.
Source · StylePatch.swift:13dim
var dim: Bool?A public field of this type. Its value type and mutability are shown in the declaration.
Source · StylePatch.swift:14strikethrough
var strikethrough: Bool?A public field of this type. Its value type and mutability are shown in the declaration.
Source · StylePatch.swift:15underlineColor
var underlineColor: Color?A public field of this type. Its value type and mutability are shown in the declaration.
Source · StylePatch.swift:16blink
var blink: Blink?A public field of this type. Its value type and mutability are shown in the declaration.
Source · StylePatch.swift:18applying(_:)
func applying(_ patch: StylePatch) -> StylePatchComposes another patch after this one.
Its specified attributes take precedence.
Applying the result to a style is equivalent to applying the two patches in order.
Parameters (1)
patch- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns StylePatch.