roundel
API reference

roundel/kleur/colors

Every export of roundel/kleur/colors, with its signature and doc comment: $, reset, bold, dim, italic, underline and 21 more, plus 1 type.

import { $, reset, bold, … } from 'roundel/kleur/colors';

Constants

$

The switch every function reads: kleur's decision at import, and whatever a caller assigns after.

const $: {
    enabled: boolean;
};

bgBlack

const bgBlack: Colorize;

bgBlue

const bgBlue: Colorize;

bgCyan

const bgCyan: Colorize;

bgGreen

const bgGreen: Colorize;

bgMagenta

const bgMagenta: Colorize;

bgRed

const bgRed: Colorize;

bgWhite

const bgWhite: Colorize;

bgYellow

const bgYellow: Colorize;

black

const black: Colorize;

blue

const blue: Colorize;

bold

const bold: Colorize;

cyan

const cyan: Colorize;

dim

const dim: Colorize;

gray

const gray: Colorize;

green

const green: Colorize;

grey

const grey: Colorize;

hidden

const hidden: Colorize;

inverse

const inverse: Colorize;

italic

const italic: Colorize;

magenta

const magenta: Colorize;

red

const red: Colorize;

reset

const reset: Colorize;

strikethrough

const strikethrough: Colorize;

underline

const underline: Colorize;

white

const white: Colorize;

yellow

const yellow: Colorize;

Interfaces

Colorize

One function, typed as kleur/colors declares it: a value styled, nothing and null returned as given.

interface Colorize {
    (input: string | boolean | number): string;
    (input: undefined | void): undefined;
    (input: null): null;
}

On this page