function fgBg256
fgBg256(
fg: number,
bg?: number,
): string

Generates ANSI escape codes for setting both the text (foreground) and background colors using 8-bit color codes.

Parameters

fg: number
  • The 8-bit color code for the foreground (0-255).
optional
bg: number
  • The 8-bit color code for the background (0-255).

Return Type

string

The ANSI escape code string for setting both the text and background colors.

Usage

import { fgBg256 } from "sgr/8bit.ts";