Interface StringFormat

interface StringFormat {
    end: string;
    prefix: string;
    start: Fn<number, string>;
    suffix: string;
    zero?: boolean;
    format(code, x): string;
}

Properties

Methods

Properties

end: string

Format end string (e.g. to ANSI reset or </span>).

prefix: string

Prefix for each canvas row / line result string

start: Fn<number, string>

Function translating format codes (e.g. BG_RED) to the actual output format. This function will only be called when needed, i.e. when a character's format is different than that of the previous.

suffix: string

Suffix for each canvas row / line result string (e.g. linebreak)

zero?: boolean

If true, DON'T skip 0-valued format IDs during formatting.

Remarks

This is needed for various custom color-only formats, e.g. in order to reproduce black in FMT_ANSI565. In the default format, a zero refers to the default format of the target.

Default Value

false

Methods

Generated using TypeDoc