ANSI Color Codes Cheat Sheet

Diving into the world of computer programming often involves navigating a plethora of commands and codes. Among these, the American National Standard Institute (ANSI) color codes play a significant role in adding color and vibrancy to the otherwise monochromatic text-based interfaces in consoles and terminal applications. If you're eager to liven up your command-line experience,TORF you've come to the right place.

Client Challenge
Client Challenge

In this comprehensive guide, we'll explore the ANSI color codes list and guide you on how to apply these colors in your bash scripts or any other terminal-based applications. So, let's get started and brighten up that dull console!

the color chart for different types of colors
the color chart for different types of colors

Understanding ANSI Color Codes

ANSI color codes are a set of numeric codes that correspond to specific colors. These codes are understood by terminal emulators and allow users to print colored text and background in their console output. The codes are based on the original ANSI standard, which defined eight basic colors.

Organized & Aesthetic: Color Codes for Google Sheets in Every Shade🌟
Organized & Aesthetic: Color Codes for Google Sheets in Every Shade🌟

Before we dive into the detailed codes, let's first understand the syntax to use these codes: `[m`, where `` is the escape character and `` is the color code. Now, let's move on to the actual codes.

ANSI 30 and 40 Series: Basic Colors

an image of the color code for different types of colors and numbers, including red, yellow
an image of the color code for different types of colors and numbers, including red, yellow

The 30-series codes represent the basic eight colors, while the 40-series codes represent their respective backgrounds. Here's a brief overview of these basic colors:

...
Color Code Color
30 Black
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White
40 Black background
47 White background

For instance, to print text in red, you'd use `[31m` before your text, and to print text with a blue background, you'd use `[44m`.

100+ Trending Canva Color Palette Hex Codes 🎨
100+ Trending Canva Color Palette Hex Codes 🎨

ANSI 90 Series: Bright Colors

In addition to the basic colors, ANSI also defined a brighter version of each color using the 90-series codes. These bright colors provide more vibrant alternatives to their darker counterparts. Here's a list of these bright colors:

  • 90 - Bright black (white with atransfer)
  • 91 - Bright red
  • 92 - Bright green
  • 93 - Bright yellow
  • 94 - Bright blue
  • 95 - Bright magenta
  • 96 - Bright cyan
  • 97 - Bright white
the color chart for each type of paint
the color chart for each type of paint

To use these bright colors, simply replace the basic color codes with their corresponding bright code. For example, `[91m` is used to print text in bright red.

Resetting Colors and Other Formatting

the color chart for different colors and numbers on this page is an excellent way to describe what
the color chart for different colors and numbers on this page is an excellent way to describe what
an image of color chart for the different colors in each section, including red, yellow, green and blue
an image of color chart for the different colors in each section, including red, yellow, green and blue
brazilian summer ☀️ | dti hex code color palette
brazilian summer ☀️ | dti hex code color palette
an image of the color chart for different colors
an image of the color chart for different colors
the color chart for all kinds of colors
the color chart for all kinds of colors
the color code for all different colors
the color code for all different colors
an image of color chart with different colors and numbers on it, including the names
an image of color chart with different colors and numbers on it, including the names
the color chart for different types of paints and their corresponding colors are shown in this image
the color chart for different types of paints and their corresponding colors are shown in this image
the color chart for different shades of red, orange, yellow and blue in various colors
the color chart for different shades of red, orange, yellow and blue in various colors
Color
Color
the color chart for rgb hex tripit core chart is shown in this image
the color chart for rgb hex tripit core chart is shown in this image
Colors!!
Colors!!
색상과제
색상과제
the color chart for different shades of paint
the color chart for different shades of paint
🎨 GoodNotes Hex Code Palette – Aesthetic Color Inspiration!
🎨 GoodNotes Hex Code Palette – Aesthetic Color Inspiration!
GoodNotes marker and pen colours
GoodNotes marker and pen colours
Steel_15
Steel_15
the color chart for artkal's watercolor paints
the color chart for artkal's watercolor paints
Client Challenge
Client Challenge
the different font styles and colors for each type of poster or print, including red, brown
the different font styles and colors for each type of poster or print, including red, brown

After introducing color to your console output, you might want to return to the default color. This can be achieved using the code `[0m` or `[Reset`. Additionally, ANSI also supports other formatting options like bold, underline, and other text attributes using the following codes:

  • 1 - Activate bold mode
  • 4 - Underline mode
  • 7 - Reverse video mode (swaps foreground and background colors)

To use these formatting codes, simply replace `` in the syntax `[m` with the desired code. For example, `[1m` makes the text bold, while `[4m` makes it underlined.

With this comprehensive list of ANSI color codes, you're now equipped to add color and vibrancy to your terminal-based applications. Happy coding, and don't forget to have fun exploring and incorporating these colors into your projects!

Related Articles

Thanksgiving Coloring By Number Pages Color By Time Free What Is The Color Code For Sky Blue Color Tip Press On Nails Color By Numbers Turtle What Is The Best Color By Number App For Kids Color By Number Turtle Printable What Color Is My Car By Vin Number Free What Is The Color Code For Baby Blue What's The Best Color By Number App