TermColor.Style: composable terminal styles #
A style is a sequence of SGR settings. An attribute setting carries either true or false,
so it can enable or disable a surrounding attribute; an absent setting means inherit. Settings
are applied from left to right, and later settings therefore take precedence for overlapping
properties. This is the same small algebra used by ANSI itself.
The text attributes represented by common SGR terminals.
- bold : Attribute
Bold text.
- dim : Attribute
Dim text.
- italic : Attribute
Italic text.
- underline : Attribute
Underlined text.
- blink : Attribute
Blinking text.
- rapidBlink : Attribute
Rapidly blinking text.
- reverse : Attribute
Reversed foreground and background.
- conceal : Attribute
Concealed text.
- strike : Attribute
Struck-through text.
- doubleUnderline : Attribute
Double-underlined text.
- framed : Attribute
Framed text.
- encircled : Attribute
Encircled text.
- overlined : Attribute
Overlined text.
Instances For
Equations
- TermColor.instBEqAttribute.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
Equations
- TermColor.instReprAttribute = { reprPrec := TermColor.instReprAttribute.repr }
Equations
- One or more equations did not get rendered due to their size.
- TermColor.instReprAttribute.repr TermColor.Attribute.bold prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TermColor.Attribute.bold")).group prec✝
- TermColor.instReprAttribute.repr TermColor.Attribute.dim prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TermColor.Attribute.dim")).group prec✝
- TermColor.instReprAttribute.repr TermColor.Attribute.italic prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TermColor.Attribute.italic")).group prec✝
- TermColor.instReprAttribute.repr TermColor.Attribute.blink prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TermColor.Attribute.blink")).group prec✝
- TermColor.instReprAttribute.repr TermColor.Attribute.strike prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TermColor.Attribute.strike")).group prec✝
- TermColor.instReprAttribute.repr TermColor.Attribute.framed prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TermColor.Attribute.framed")).group prec✝
Instances For
Equations
Equations
- TermColor.instBEqSetting.beq (TermColor.Setting.foreground a) (TermColor.Setting.foreground b) = (a == b)
- TermColor.instBEqSetting.beq (TermColor.Setting.background a) (TermColor.Setting.background b) = (a == b)
- TermColor.instBEqSetting.beq (TermColor.Setting.attr a a_1) (TermColor.Setting.attr b b_1) = (a == b && a_1 == b_1)
- TermColor.instBEqSetting.beq x✝¹ x✝ = false
Instances For
Equations
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.foreground a) (TermColor.Setting.foreground b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.foreground a) (TermColor.Setting.background a_1) = isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.foreground a) (TermColor.Setting.attr a_1 a_2) = isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.background a) (TermColor.Setting.foreground a_1) = isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.background a) (TermColor.Setting.background b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.background a) (TermColor.Setting.attr a_1 a_2) = isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.attr a a_1) (TermColor.Setting.foreground a_2) = isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.attr a a_1) (TermColor.Setting.background a_2) = isFalse ⋯
- TermColor.instDecidableEqSetting.decEq (TermColor.Setting.attr a a_1) (TermColor.Setting.attr b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
Instances For
Equations
- TermColor.instReprSetting = { reprPrec := TermColor.instReprSetting.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
A composable sequence of terminal settings.
Settings applied from left to right.
Instances For
Equations
- TermColor.instBEqStyle.beq { settings := a } { settings := b } = (a == b)
- TermColor.instBEqStyle.beq x✝¹ x✝ = false
Instances For
Equations
Equations
- TermColor.instReprStyle = { reprPrec := TermColor.instReprStyle.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
The empty style sequence.
Equations
Instances For
Combine styles, applying the right-hand settings after the left-hand settings.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A foreground-color setting.
Equations
- TermColor.Style.fg color = { settings := [TermColor.Setting.foreground color] }
Instances For
A background-color setting.
Equations
- TermColor.Style.bg color = { settings := [TermColor.Setting.background color] }
Instances For
Turn one attribute on.
Instances For
Turn dim text on.
Instances For
Turn italic text on.
Instances For
Turn underlining on.
Equations
Instances For
Turn blinking on.
Instances For
Turn rapid blinking on.
Equations
Instances For
Turn reverse video on.
Instances For
Turn concealment on.
Instances For
Turn strike-through on.
Instances For
Turn double underlining on.
Equations
Instances For
Turn framing on.
Instances For
Turn encircling on.
Equations
Instances For
Turn overlining on.
Equations
Instances For
Turn one attribute off in an overlay.
Instances For
Turn dim text off in an overlay.
Instances For
Turn italic text off in an overlay.
Instances For
Turn underlining off in an overlay.
Equations
Instances For
Turn blinking off in an overlay.
Instances For
Turn rapid blinking off in an overlay.
Equations
Instances For
Turn reverse video off in an overlay.
Equations
Instances For
Turn concealment off in an overlay.
Equations
Instances For
Turn strike-through off in an overlay.
Instances For
Turn double underlining off in an overlay.
Equations
Instances For
Turn framing off in an overlay.
Instances For
Turn encircling off in an overlay.
Equations
Instances For
Turn overlining off in an overlay.
Equations
Instances For
A black foreground style.
Instances For
A red foreground style.
Instances For
A green foreground style.
Instances For
A yellow foreground style.
Instances For
A blue foreground style.
Instances For
A magenta foreground style.
Instances For
A cyan foreground style.
Instances For
A white foreground style.
Instances For
A black background style.
Instances For
A red background style.
Instances For
A green background style.
Instances For
A yellow background style.
Instances For
A blue background style.
Instances For
A magenta background style.
Instances For
A cyan background style.
Instances For
A white background style.