diff options
| author | Casper Beyer <caspervonb@pm.me> | 2020-08-29 16:29:41 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-29 10:29:41 +0200 |
| commit | 8ca903f6494ebe9eba4ff33a494e644b2d886053 (patch) | |
| tree | ceaf02363d224a3fdaa6b69139a2b634d3c8e405 /std/fmt/colors.ts | |
| parent | d6dc797d155d85bbe8011b2f58c9b66267d557dd (diff) | |
feat(std/fmt): add bright color variations (#7241)
Diffstat (limited to 'std/fmt/colors.ts')
| -rw-r--r-- | std/fmt/colors.ts | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/std/fmt/colors.ts b/std/fmt/colors.ts index 7a12b2883..bb0f334fa 100644 --- a/std/fmt/colors.ts +++ b/std/fmt/colors.ts @@ -120,9 +120,41 @@ export function white(str: string): string { } export function gray(str: string): string { + return brightBlack(str); +} + +export function brightBlack(str: string): string { return run(str, code([90], 39)); } +export function brightRed(str: string): string { + return run(str, code([91], 39)); +} + +export function brightGreen(str: string): string { + return run(str, code([92], 39)); +} + +export function brightYellow(str: string): string { + return run(str, code([93], 39)); +} + +export function brightBlue(str: string): string { + return run(str, code([94], 39)); +} + +export function brightMagenta(str: string): string { + return run(str, code([95], 39)); +} + +export function brightCyan(str: string): string { + return run(str, code([96], 39)); +} + +export function brightWhite(str: string): string { + return run(str, code([97], 39)); +} + export function bgBlack(str: string): string { return run(str, code([40], 49)); } @@ -155,6 +187,38 @@ export function bgWhite(str: string): string { return run(str, code([47], 49)); } +export function bgBrightBlack(str: string): string { + return run(str, code([100], 49)); +} + +export function bgBrightRed(str: string): string { + return run(str, code([101], 49)); +} + +export function bgBrightGreen(str: string): string { + return run(str, code([102], 49)); +} + +export function bgBrightYellow(str: string): string { + return run(str, code([103], 49)); +} + +export function bgBrightBlue(str: string): string { + return run(str, code([104], 49)); +} + +export function bgBrightMagenta(str: string): string { + return run(str, code([105], 49)); +} + +export function bgBrightCyan(str: string): string { + return run(str, code([106], 49)); +} + +export function bgBrightWhite(str: string): string { + return run(str, code([107], 49)); +} + /* Special Color Sequences */ function clampAndTruncate(n: number, max = 255, min = 0): number { |
