Skip to content

Terminal

Terminal Color Codes

ANSI ECMA-48 SGR foreground and background codes for CLIs, logs, and TUIs. Terminals map 16/256/truecolor differently — test on your target emulator. Spec reference: Documentation.

Open ANSI color codes →

Starter template

# Truecolor foreground (24-bit)
\x1b[38;2;124;58;237mPurple text\x1b[0m

# 16-color bright green
\x1b[92mSuccess\x1b[0m

Color samples

FAQ

16-color vs truecolor (24-bit)?

Codes 30–37 and 90–97 are classic 16-color foreground. \x1b[38;2;r;g;bm needs a terminal that supports truecolor — test in your CI log viewer and SSH client.

More ANSI examples?

See the dedicated ANSI terminal color codes gaming reference for SGR tables and plugin-oriented snippets.

Can I copy the syntax chips?

Yes — click the secondary chip to copy platform syntax. HEX and RGB chips copy sRGB values for mockups, design handoff, and ChromaXP tools.

Are RGB and CMYK print-ready?

RGB and CMYK here are computed from HEX for quick reference. For ink and paper, re-check against your print profile or Pantone bridge.