bgRgb8

import { bgRgb8 } from "jsr:@ende/fmt/colors";

function

function bgRgb8(str: string, color: number): string

Set background color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

str: string

The text to set the background color of

color: number

The color code

Returns

The text with paletted 8bit background color

Example: Usage

import { bgRgb8 } from "@ende/fmt/colors";

console.log(bgRgb8("Hello, world!", 42));

Source