Skip to content

How to Use ANSI Escape Codes 🎨#

Colorist uses ANSI escape codes to style text in the terminal. This section explains how ANSI escape codes work, and how to use them in your own code.

If you're new to ANSI escape codes, start with the introduction to learn the basics.

Range of standard colors   Standard 16 Colors#

Use the standard palette of 16 colors to add color to both text and background with ANSI escape codes.

Range of RGB colors   Extended 256 and RGB Colors#

If your terminal supports an extended color space, you can use 256 extended colors or RGB colors to add more variety to your terminal output.

Animated effects   Effects#

ANSI escape codes can also be used to apply effects and styling to your terminal output.

Become a Sponsor

If you find this project helpful, please consider supporting its development. Your donations will help keep it alive and growing. Every contribution, no matter the size, makes a difference.

Donate on GitHub Sponsors

Thank you for your support! 🙌