@chromakit/core
    Preparing search index...

    Function bgColor

    • Wrap text with an ANSI background color escape sequence.

      Parameters

      • text: string

        The string to style.

      • color: string

        The color to use for the background; hex code or named.

      Returns string

      The ANSI-wrapped text with a background color and reset suffix.

      • Similar to color, but applies background color using rgbToAnsiBg (e.g. \u001b[48;2;r;g;bm).
      • If the provided color is invalid, it defaults to white.
      • ANSI_RESET is appended to clear all styling after the text.
      bgColor("Warning", "#ffff00"); // yellow background
      bgColor("Alert", "unknown"); // white background fallback