diff options
Diffstat (limited to 'doc/api/util.md')
-rw-r--r-- | doc/api/util.md | 67 |
1 files changed, 63 insertions, 4 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index ac23f138ad..88e2f34b7c 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -678,13 +678,72 @@ The default styles and associated colors are: * `symbol`: `green` * `undefined`: `grey` -The predefined color codes are: `white`, `grey`, `black`, `blue`, `cyan`, -`green`, `magenta`, `red` and `yellow`. There are also `bold`, `italic`, -`underline` and `inverse` codes. - Color styling uses ANSI control codes that may not be supported on all terminals. To verify color support use [`tty.hasColors()`][]. +Predefined control codes are listed below (grouped as "Modifiers", "Foreground +colors", and "Background colors"). + +#### Modifiers + +Modifier support varies throughout different terminals. They will mostly be +ignored, if not supported. + +* `reset` - Resets all (color) modifiers to their defaults +* **bold** - Make text bold +* _italic_ - Make text italic +* <span style="border-bottom: 1px;">underline</span> - Make text underlined +* ~~strikethrough~~ - Puts a horizontal line through the center of the text + (Alias: `strikeThrough`, `crossedout`, `crossedOut`) +* `hidden` - Prints the text, but makes it invisible (Alias: conceal) +* <span style="opacity: 0.5;">dim</span> - Decreased color intensity (Alias: + `faint`) +* <span style="border-top: 1px">overlined</span> - Make text overlined +* blink - Hides and shows the text in an interval +* <span style="filter: invert(100%)">inverse</span> - Swap foreground and + background colors (Alias: `swapcolors`, `swapColors`) +* <span style="border-bottom: 1px double;">doubleunderline</span> - Make text + double underlined (Alias: `doubleUnderline`) +* <span style="border: 1px">framed</span> - Draw a frame around the text + +#### Foreground colors + +* `black` +* `red` +* `green` +* `yellow` +* `blue` +* `magenta` +* `cyan` +* `white` +* `gray` (alias: `grey`, `blackBright`) +* `redBright` +* `greenBright` +* `yellowBright` +* `blueBright` +* `magentaBright` +* `cyanBright` +* `whiteBright` + +#### Background colors + +* `bgBlack` +* `bgRed` +* `bgGreen` +* `bgYellow` +* `bgBlue` +* `bgMagenta` +* `bgCyan` +* `bgWhite` +* `bgGray` (alias: `bgGrey`, `bgBlackBright`) +* `bgRedBright` +* `bgGreenBright` +* `bgYellowBright` +* `bgBlueBright` +* `bgMagentaBright` +* `bgCyanBright` +* `bgWhiteBright` + ### Custom inspection functions on Objects <!-- type=misc --> |