Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/crayon/src/crayon.ts>Crayon

🖍️ Terminal styling done light and fast.
Latest
type alias Crayon
import { type Crayon } from "https://deno.land/x/crayon@3.3.3/src/crayon.ts";

Crayon type which can be easily extended C - literal string type for extending styles O - object which expands

Type Parameters

optional
C extends string = never
optional
O extends Record<string, unknown> = Record<never, never>
definition:
& ((single: unknown, ...many: unknown[]) => string)
& prototype
& { styleBuffer: string; usesFunc: boolean; reprepareCache?(): void; keyword(style: Style): Crayon<C, O>; keyword(style: string): Crayon<C, O>; ansi3(code: number): Crayon<C, O>; bgAnsi3(code: number): Crayon<C, O>; ansi4(code: number): Crayon<C, O>; bgAnsi4(code: number): Crayon<C, O>; ansi8(code: number): Crayon<C, O>; bgAnsi8(code: number): Crayon<C, O>; rgb(
r: number,
g: number,
b: number,
): Crayon<C, O>; bgRgb(
r: number,
g: number,
b: number,
): Crayon<C, O>; hsl(
h: number,
s: number,
l: number,
): Crayon<C, O>; bgHsl(
h: number,
s: number,
l: number,
): Crayon<C, O>; hex(hex: string | number): Crayon<C, O>; bgHex(hex: string | number): Crayon<C, O>; }
& [style in Style | C]: Crayon<C, O>
& O