TerminalTextFormatting¶
Defines convenient helper functions for visually formatting text/string-able content.
trait ref TerminalTextFormatting
Public Functions¶
hide¶
Return the value as an escape-styled "concealed" string ready for the terminal.
fun box hide(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
conceal¶
Return the value as an escape-styled "concealed" string ready for the terminal.
fun box conceal(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
bold¶
Return the value as an escape-styled "bold" string ready for the terminal.
fun box bold(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
faint¶
Return the value as an escape-styled "faint" (dim) string ready for the terminal.
fun box faint(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
invert¶
Return the value as an escape-styled string with foreground and background color inverted and ready for the terminal.
fun box invert(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
italics¶
Return the value as an escape-styled "italicized" string ready for the terminal.
fun box italics(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
underline¶
Return the value as an escape-styled "underlined" string ready for the terminal.
fun box underline(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
strikeout¶
Return the value as an escape-styled "struck out" string ready for the terminal.
fun box strikeout(
value: Stringable val)
: String val
Parameters¶
- value: Stringable val
Returns¶
- String val
color¶
Return the value escaped by 8-bit colour codes for foreground and (optional) background colours.
fun box color(
value: Stringable val,
fg: U8 val,
bg: (None val | U8 val) = reference)
: String val
Parameters¶
- value: Stringable val
- fg: U8 val
- bg: (None val | U8 val) = reference
Returns¶
- String val
color_with¶
Return the value surrounded by supplied escape codes for foreground and (optional) background colours.
fun box color_with(
value: Stringable val,
fg: String val,
bg: (None val | String val) = reference)
: String val
Parameters¶
- value: Stringable val
- fg: String val
- bg: (None val | String val) = reference
Returns¶
- String val