Function rgb8

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

    Parameters

    • str: string

      The text color to apply paletted 8bit colors to

    • color: number

      The color code

    Returns string

    The text with paletted 8bit color

    import { rgb8 } from "@std/fmt/colors";

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