DuckDB Terminal - v0.2.0
    Preparing search index...

    Function colorize

    • Apply color to text. Accepts either a VT100 escape code constant (e.g., FG_RED) or a named color string (e.g., 'red').

      Parameters

      • text: string

        The text to colorize

      • color: string

        Either a VT100 escape code or a named color ('red', 'green', 'yellow', 'blue', 'cyan', 'magenta', 'white', 'black', or 'bright' variants)

      Returns string

      The text wrapped with the color escape codes

      // Using VT100 constants
      colorize('Error', FG_RED)
      // Using named colors
      colorize('Success', 'green')