Terminal Color Picker
Click any color to see its ANSI code, escape sequence, and usage examples for bash, Python, and Node.js. Covers all 256 xterm colors.
Standard 16 Colors
256-Color Extended Palette
Colors 16–231 form a 6×6×6 RGB cube. Colors 232–255 are a grayscale ramp.
Frequently Asked Questions
What are ANSI escape codes?▼
ANSI escape codes are byte sequences that terminals interpret as commands rather than printable characters. They start with ESC (ASCII 27, written as \033, \x1b, or \e) followed by [ and a parameter list. For colors: \033[31m sets foreground red, \033[0m resets all attributes. They're standardized by ECMA-48 and supported by virtually every Unix terminal emulator.
What is the difference between 16, 256, and truecolor?▼
The 16 standard colors (codes 30–37, 90–97 for fg) are the oldest and most portable. 256-color mode (\033[38;5;Nm) adds a 6x6x6 color cube plus a 24-step grayscale ramp — supported by xterm, iTerm2, GNOME Terminal, and most modern terminals. Truecolor (\033[38;2;R;G;Bm) allows any 24-bit RGB value — supported by iTerm2, Kitty, Alacritty, Windows Terminal (v1.10+), and VS Code's integrated terminal.
How do I use ANSI colors in a bash script?▼
Define color variables at the top: RED='\033[31m' and RESET='\033[0m', then use them with echo -e or printf. Example: echo -e "${RED}Error: file not found${RESET}". Use printf for portability: printf '%b' "${RED}Error${RESET}\n". The -e flag tells echo to interpret escape sequences — without it, the literal characters \033 are printed.
How do I use terminal colors in Python?▼
You can use raw escape codes: print('\033[32mSuccess\033[0m'). For real projects, use the colorama library (pip install colorama) which handles Windows compatibility: from colorama import Fore, Style; print(Fore.GREEN + 'Success' + Style.RESET_ALL). For 256 colors: print('\033[38;5;208mOrange text\033[0m').
How do I use terminal colors in Node.js?▼
Raw escape codes work: console.log('\x1b[32mSuccess\x1b[0m'). The chalk library is the standard choice: const chalk = require('chalk'); console.log(chalk.green('Success')). Chalk auto-detects color support, respects NO_COLOR env var, and has a clean chaining API: chalk.bold.red('Error'). For 256 colors: chalk.ansi256(208)('Orange').
Why do colors look different in different terminals?▼
The 16 standard colors have no fixed RGB values — each terminal theme defines its own palette. What is 'red' (code 31) in one theme might be a deep maroon in another. 256-color and truecolor values are more consistent because they specify exact RGB. For maximum consistency across environments, use truecolor (\033[38;2;R;G;Bm) when you know the terminal supports it, or stick to the 256-color palette.
Related Products
on GumroadDeveloper Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →Developer Productivity Toolkit
Complete dev environment setup: VS Code settings, keybindings, snippets, shell aliases, Git hooks, tmux config, and Starship prompt. Copy, paste, code faster.
Buy on Gumroad →Premium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →You Might Also Need
Shell Script Linter
Lint Bash and shell scripts online. Detects unquoted variables, missing set -e, unsafe rm -rf, useless cat, backtick usage, and portability issues with line annotations and fix suggestions.
Open free tool →
Ansible Playbook Builder
Build Ansible playbooks visually with a task composer. Add apt, yum, copy, service, command, git, and other module tasks. Generate valid YAML playbooks.
Open free tool →
Ansible Configuration Management Guide
Complete Ansible automation guide. Learn playbooks, roles, inventory, handlers, Jinja2 templates, Ansible Galaxy, and AWX/Tower for agentless IT configuration management.
Open free tool →
More Free Tools
Related Articles
Tmux Tutorial: The Complete Developer Workflow Guide (2026)
Learn tmux from scratch — sessions, windows, panes, scripts, and a complete developer workflow. Covers tmux 3.x with configuration examples, copy-mode navigation, and pair programming setups.
Linux Command Line Basics: 15 Commands You Need to Know
Master 15 essential Linux terminal commands for navigation, file management, text processing, permissions, and process control — with practical examples.
jq 命令列 JSON 處理完全指南:範例與實戰大全
jq 是處理 JSON 資料的終極 CLI 工具。本文涵蓋篩選、轉換、陣列操作、條件判斷、格式化輸出,以及與 curl 結合的實戰 API 資料處理範例。
20 Best CLI Tools Every Developer Needs in 2026
The definitive list of CLI tools that actually improve developer productivity in 2026: navigation, file ops, search, git, system monitoring, terminal setup, and dev utilities — with install commands and real usage examples.
Ultimate Terminal Productivity Setup for Developers 2026
A complete guide to building a high-productivity terminal environment in 2026: shell selection, plugin managers, terminal emulators, multiplexers, dotfiles management, shell history, and prompt configuration — with real config examples.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →