roundel
API reference

roundel/picocolors

Every export of roundel/picocolors, with its signature and doc comment: createColors, isColorSupported, picocolors, module.exports, plus 2 types.

import picocolors from 'roundel/picocolors';
import { createColors, isColorSupported, module.exports } from 'roundel/picocolors';

Functions

createColors

The styles, coloured or not. enabled defaults to {@link isColorSupported}.

function createColors(enabled?: boolean): Colors;
ParameterType
enabled (optional)boolean

Returns Colors

Constants

default

The default export, declared as picocolors.

picocolors' module: the styles for this process, and createColors.

const picocolors: Colors & {
    createColors: typeof createColors;
};

isColorSupported

Whether picocolors would colour this process's output.

const isColorSupported: boolean;

module.exports

picocolors' module: the styles for this process, and createColors.

const picocolors: Colors & {
    createColors: typeof createColors;
};

Types

Colors

What createColors returns: whether colour is on, and every style.

type Colors = {
    isColorSupported: boolean;
} & Record<StyleName, Formatter>;

Formatter

One style: the input, stringified, between an open and a close code.

type Formatter = (input: unknown) => string;

On this page