scoop:scoop.terminal:0.1.0
scoop.terminal.style
API
-
enum
Attribute
An SGR rendition attribute or its corresponding reset instruction. Terminal support varies by attribute.
-
struct
Attributes
An immutable set of SGR attributes.
-
enum
Color
A terminal palette, indexed, RGB, or default-reset color. RGB components and palette indices are validated when serialized.
-
enum
Colored
Associates a color with foreground, background, or underline channel.
-
struct
Colors
Optional foreground and background selections; absent channels are left unchanged.
-
struct
ContentStyle
An immutable combination of optional foreground/background/underline colors and SGR attributes.
-
object
ResetColor
Emits the full SGR reset, restoring rendition defaults.
-
struct
SetAttribute
Emits one SGR attribute command.
-
struct
SetAttributes
Emits the selected SGR attributes in the library's fixed order.
-
struct
SetBackgroundColor
Sets the background color subject to the library color-output policy.
-
struct
SetColors
Sets the present foreground/background selections, preserving absent channels.
-
struct
SetForegroundColor
Sets the foreground color subject to the library color-output policy.
-
struct
SetStyle
Applies the selected style without printing content or automatically restoring it.
-
struct
SetUnderlineColor
Sets the underline color subject to the library color-output policy.
-
struct
StyledContent
Serializes style, content, and the corresponding reset commands. It restores terminal defaults for changed channels rather than saving and restoring an arbitrary prior style.
-
function
availableColorCount
Estimates color capability from COLORTERM or TERM: 65535 for true-color markers, 256 for a 256-color marker, otherwise 8. This does not probe the terminal.
-
function
forceColorOutput
Sets a process-wide explicit color-output decision, overriding the environment-derived policy.
-
function
isColorOutputEnabled
Returns the explicit override when set; otherwise a nonempty NO_COLOR disables color output.
-
function
resetColorOutput
Clears the explicit color decision so environment policy applies again.
-
function
styled
Pairs the receiver with a style for later ANSI serialization.