nimterm/style
This page is generated from the module’s exported API and ## documentation comments.
Semantic terminal styles. Backends decide how styles are serialized.
ColorKind
Section titled “ColorKind”ColorKind = enum colorDefault, colorAnsi16, colorAnsi256, colorRgbColorValue
Section titled “ColorValue”ColorValue = object kind*: ColorKind value*: int r*: int g*: int b*: intTextAttribute
Section titled “TextAttribute”TextAttribute = enum attrBold, attrDim, attrItalic, attrUnderline, attrReverse, attrStrikethroughStyle = object foreground*: ColorValue background*: ColorValue attributes*: set[TextAttribute]Procedures
Section titled “Procedures”defaultColor
Section titled “defaultColor”proc defaultColor(): ColorValue {.raises: [], tags: [], forbids: [].}Returns: ColorValue.
ansi16
Section titled “ansi16”proc ansi16(index: int): ColorValue {.raises: [], tags: [], forbids: [].}Returns: ColorValue.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
index |
int |
ansi256
Section titled “ansi256”proc ansi256(index: int): ColorValue {.raises: [], tags: [], forbids: [].}Returns: ColorValue.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
index |
int |
proc rgb(r, g, b: int): ColorValue {.raises: [], tags: [], forbids: [].}Returns: ColorValue.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
r |
int |
|
g |
int |
|
b |
int |
defaultStyle
Section titled “defaultStyle”proc defaultStyle(): Style {.raises: [], tags: [], forbids: [].}Returns: Style.
withForeground
Section titled “withForeground”proc withForeground(style: Style; color: ColorValue): Style {.raises: [], tags: [], forbids: [].}Returns: Style.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
style |
Style |
|
color |
ColorValue |
withBackground
Section titled “withBackground”proc withBackground(style: Style; color: ColorValue): Style {.raises: [], tags: [], forbids: [].}Returns: Style.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
style |
Style |
|
color |
ColorValue |
withAttribute
Section titled “withAttribute”proc withAttribute(style: Style; attribute: TextAttribute): Style {.raises: [], tags: [], forbids: [].}Returns: Style.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
style |
Style |
|
attribute |
TextAttribute |