ansi colors

public class ConsoleColors {
    // Reset
    public static final String RESET = "\033[0m";  // Text Reset

    // Regular Colors
    public static final String BLACK = "\033[0;30m";   // BLACK
    public static final String RED = "\033[0;31m";     // RED
    public static final String GREEN = "\033[0;32m";   // GREEN
    public static final String YELLOW = "\033[0;33m";  // YELLOW
    public static final String BLUE = "\033[0;34m";    // BLUE
    public static final String PURPLE = "\033[0;35m";  // PURPLE
    public static final String CYAN = "\033[0;36m";    // CYAN
    public static final String WHITE = "\033[0;37m";   // WHITE

    // Bold
    public static final String BLACK_BOLD = "\033[1;30m";  // BLACK
    public static final String RED_BOLD = "\033[1;31m";    // RED
    public static final String GREEN_BOLD = "\033[1;32m";  // GREEN
    public static final String YELLOW_BOLD = "\033[1;33m"; // YELLOW
    public static final String BLUE_BOLD = "\033[1;34m";   // BLUE
    public static final String PURPLE_BOLD = "\033[1;35m"; // PURPLE
    public static final String CYAN_BOLD = "\033[1;36m";   // CYAN
    public static final String WHITE_BOLD = "\033[1;37m";  // WHITE

    // Underline
    public static final String BLACK_UNDERLINED = "\033[4;30m";  // BLACK
    public static final String RED_UNDERLINED = "\033[4;31m";    // RED
    public static final String GREEN_UNDERLINED = "\033[4;32m";  // GREEN
    public static final String YELLOW_UNDERLINED = "\033[4;33m"; // YELLOW
    public static final String BLUE_UNDERLINED = "\033[4;34m";   // BLUE
    public static final String PURPLE_UNDERLINED = "\033[4;35m"; // PURPLE
    public static final String CYAN_UNDERLINED = "\033[4;36m";   // CYAN
    public static final String WHITE_UNDERLINED = "\033[4;37m";  // WHITE

    // Background
    public static final String BLACK_BACKGROUND = "\033[40m";  // BLACK
    public static final String RED_BACKGROUND = "\033[41m";    // RED
    public static final String GREEN_BACKGROUND = "\033[42m";  // GREEN
    public static final String YELLOW_BACKGROUND = "\033[43m"; // YELLOW
    public static final String BLUE_BACKGROUND = "\033[44m";   // BLUE
    public static final String PURPLE_BACKGROUND = "\033[45m"; // PURPLE
    public static final String CYAN_BACKGROUND = "\033[46m";   // CYAN
    public static final String WHITE_BACKGROUND = "\033[47m";  // WHITE

    // High Intensity
    public static final String BLACK_BRIGHT = "\033[0;90m";  // BLACK
    public static final String RED_BRIGHT = "\033[0;91m";    // RED
    public static final String GREEN_BRIGHT = "\033[0;92m";  // GREEN
    public static final String YELLOW_BRIGHT = "\033[0;93m"; // YELLOW
    public static final String BLUE_BRIGHT = "\033[0;94m";   // BLUE
    public static final String PURPLE_BRIGHT = "\033[0;95m"; // PURPLE
    public static final String CYAN_BRIGHT = "\033[0;96m";   // CYAN
    public static final String WHITE_BRIGHT = "\033[0;97m";  // WHITE

    // Bold High Intensity
    public static final String BLACK_BOLD_BRIGHT = "\033[1;90m"; // BLACK
    public static final String RED_BOLD_BRIGHT = "\033[1;91m";   // RED
    public static final String GREEN_BOLD_BRIGHT = "\033[1;92m"; // GREEN
    public static final String YELLOW_BOLD_BRIGHT = "\033[1;93m";// YELLOW
    public static final String BLUE_BOLD_BRIGHT = "\033[1;94m";  // BLUE
    public static final String PURPLE_BOLD_BRIGHT = "\033[1;95m";// PURPLE
    public static final String CYAN_BOLD_BRIGHT = "\033[1;96m";  // CYAN
    public static final String WHITE_BOLD_BRIGHT = "\033[1;97m"; // WHITE

    // High Intensity backgrounds
    public static final String BLACK_BACKGROUND_BRIGHT = "\033[0;100m";// BLACK
    public static final String RED_BACKGROUND_BRIGHT = "\033[0;101m";// RED
    public static final String GREEN_BACKGROUND_BRIGHT = "\033[0;102m";// GREEN
    public static final String YELLOW_BACKGROUND_BRIGHT = "\033[0;103m";// YELLOW
    public static final String BLUE_BACKGROUND_BRIGHT = "\033[0;104m";// BLUE
    public static final String PURPLE_BACKGROUND_BRIGHT = "\033[0;105m"; // PURPLE
    public static final String CYAN_BACKGROUND_BRIGHT = "\033[0;106m";  // CYAN
    public static final String WHITE_BACKGROUND_BRIGHT = "\033[0;107m";   // WHITE
}

3.8
10

                                    Black            \e[0;30m
Blue             \e[0;34m
Green            \e[0;32m
Cyan             \e[0;36m
Red              \e[0;31m
Purple           \e[0;35m
Brown            \e[0;33m
Gray             \e[0;37m
Dark Gray        \e[1;30m
Light Blue       \e[1;34m
Light Green      \e[1;32m
Light Cyan       \e[1;36m
Light Red        \e[1;31m
Light Purple     \e[1;35m
Yellow           \e[1;33m
White            \e[1;37m

3.8 (10 Votes)
0
4.11
9

                                    # Red 
print(u"\u001b[31mHello World")

# Black: \u001b[30m
# Red: \u001b[31m
# Green: \u001b[32m
# Yellow: \u001b[33m
# Blue: \u001b[34m
# Magenta: \u001b[35m
# Cyan: \u001b[36m
# White: \u001b[37m
# Reset: \u001b[0m

4.11 (9 Votes)
0
4.5
4

                                    enum Color {
    //Color end string, color reset
    RESET("\033[0m"),

    // Regular Colors. Normal color, no bold, background color etc.
    BLACK("\033[0;30m"),    // BLACK
    RED("\033[0;31m"),      // RED
    GREEN("\033[0;32m"),    // GREEN
    YELLOW("\033[0;33m"),   // YELLOW
    BLUE("\033[0;34m"),     // BLUE
    MAGENTA("\033[0;35m"),  // MAGENTA
    CYAN("\033[0;36m"),     // CYAN
    WHITE("\033[0;37m"),    // WHITE

    // Bold
    BLACK_BOLD("\033[1;30m"),   // BLACK
    RED_BOLD("\033[1;31m"),     // RED
    GREEN_BOLD("\033[1;32m"),   // GREEN
    YELLOW_BOLD("\033[1;33m"),  // YELLOW
    BLUE_BOLD("\033[1;34m"),    // BLUE
    MAGENTA_BOLD("\033[1;35m"), // MAGENTA
    CYAN_BOLD("\033[1;36m"),    // CYAN
    WHITE_BOLD("\033[1;37m"),   // WHITE

    // Underline
    BLACK_UNDERLINED("\033[4;30m"),     // BLACK
    RED_UNDERLINED("\033[4;31m"),       // RED
    GREEN_UNDERLINED("\033[4;32m"),     // GREEN
    YELLOW_UNDERLINED("\033[4;33m"),    // YELLOW
    BLUE_UNDERLINED("\033[4;34m"),      // BLUE
    MAGENTA_UNDERLINED("\033[4;35m"),   // MAGENTA
    CYAN_UNDERLINED("\033[4;36m"),      // CYAN
    WHITE_UNDERLINED("\033[4;37m"),     // WHITE

    // Background
    BLACK_BACKGROUND("\033[40m"),   // BLACK
    RED_BACKGROUND("\033[41m"),     // RED
    GREEN_BACKGROUND("\033[42m"),   // GREEN
    YELLOW_BACKGROUND("\033[43m"),  // YELLOW
    BLUE_BACKGROUND("\033[44m"),    // BLUE
    MAGENTA_BACKGROUND("\033[45m"), // MAGENTA
    CYAN_BACKGROUND("\033[46m"),    // CYAN
    WHITE_BACKGROUND("\033[47m"),   // WHITE

    // High Intensity
    BLACK_BRIGHT("\033[0;90m"),     // BLACK
    RED_BRIGHT("\033[0;91m"),       // RED
    GREEN_BRIGHT("\033[0;92m"),     // GREEN
    YELLOW_BRIGHT("\033[0;93m"),    // YELLOW
    BLUE_BRIGHT("\033[0;94m"),      // BLUE
    MAGENTA_BRIGHT("\033[0;95m"),   // MAGENTA
    CYAN_BRIGHT("\033[0;96m"),      // CYAN
    WHITE_BRIGHT("\033[0;97m"),     // WHITE

    // Bold High Intensity
    BLACK_BOLD_BRIGHT("\033[1;90m"),    // BLACK
    RED_BOLD_BRIGHT("\033[1;91m"),      // RED
    GREEN_BOLD_BRIGHT("\033[1;92m"),    // GREEN
    YELLOW_BOLD_BRIGHT("\033[1;93m"),   // YELLOW
    BLUE_BOLD_BRIGHT("\033[1;94m"),     // BLUE
    MAGENTA_BOLD_BRIGHT("\033[1;95m"),  // MAGENTA
    CYAN_BOLD_BRIGHT("\033[1;96m"),     // CYAN
    WHITE_BOLD_BRIGHT("\033[1;97m"),    // WHITE

    // High Intensity backgrounds
    BLACK_BACKGROUND_BRIGHT("\033[0;100m"),     // BLACK
    RED_BACKGROUND_BRIGHT("\033[0;101m"),       // RED
    GREEN_BACKGROUND_BRIGHT("\033[0;102m"),     // GREEN
    YELLOW_BACKGROUND_BRIGHT("\033[0;103m"),    // YELLOW
    BLUE_BACKGROUND_BRIGHT("\033[0;104m"),      // BLUE
    MAGENTA_BACKGROUND_BRIGHT("\033[0;105m"),   // MAGENTA
    CYAN_BACKGROUND_BRIGHT("\033[0;106m"),      // CYAN
    WHITE_BACKGROUND_BRIGHT("\033[0;107m");     // WHITE

    private final String code;

    Color(String code) {
        this.code = code;
    }

    @Override
    public String toString() {
        return code;
    }
}

4.5 (4 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
ansi red color ansii color codes chart ANSI CODE COLORS ansi codes colors ansi color chart all ansi color codees terminal ansi colors ansi colour code ansi code for colors ansi code color list ansi color escapes ansi colors c ansi lime color codes ansi lime colors ansi code colour color in ansi Ansi background colors ansi color codes list ansi escape color codes ansi colours# ansi colors table Ansi code for colores ansi colors orange ansi colors logo color ansi code color ansi ansi colors are what ansi color codes c code ansi color ansi colors documentations ansi terminal colors ansi color white code ansi color white #define c ansi colors ansii color codes draw with ansi colors ANSI white color ansi escape colors ansi color background ansi color values colors ansi ansi colour codes ansi colors pypi ansi colours clear screen excape code ansi color code chart 256 ansi color code terminal ansi escape sequences color python ansi escape codes for colours of rainow using ansi escape codes python ascii colour codes plain text color control characters, ansi color codes python 2.7 example log with color ansi color escaping c highlight characters in terminal screen with ansi how to highlight text on the terminal text with ansi codes red text ansi escape codes ansi escpae codes ord unix colour codes ansi escpace code backspace python ANSI sequences in termial pythpon ansi color code color escape sequences how to use ansi escape codes ansi command line How to take input from ansi console temrinal text color ansi escape codes color ansi escape sequences python colors command line color codes ansi escape code default color color escape codes ansi escape for hite terminal color escape codes ansi COLO ansi color codes none terminal color codes linux ansi sequence reset java what is the ansi of white background ascii colours use ansi escape sequence colors Use ANSI Escape Sequences python white background ascii ascii code colors ansi escape sequences color codes ansi escape code builder escape code print character red mac terminal print ansi colors asci colors console escape codes python ansi escape codes color red ansi colors codes c++ ansi colorscodes c++ ansi color codes c++ ansi escape sequences ascii color code list of python color ANSI escape sequences render ansii escape online escape character clmear screen bold ansi ansi console colors AnsiFore colors ansi escape codes colors ansi color codes hex how to use ansi escape sequences in python ansi code in python ansii colors escape sequences for colors in python ansi commands ANSI color table ansi color codes decorticate ansi color codes blink color codes for linux terminal 16 bit color escape codes ansi escape code orange how to get ansi color codes cli color codes color codes terminal terminal colors for code on linux terminal colors for code dark green ansi python ansi code python ansi escape clear escape char to clear line linux cli colour codes ANSI no color dark blue ansi dark blue ANSI escape code python ansi escape codes bright black ansi escape escape sequence for blue ansi default color ansi color linux terminal colors codes ANSI escape sequences colour what is an ansi color ansi code blue color int erminal ascii color codes python anc colors ansi background color red color text ansi ANSI escape sequence red ansi color code formatter ansi reset color code ansi red ansi bright green ansi standard color ansi code bg white ansi code color using ansi escape codes syntax how to use ansii escape codes in c for ascii art ansi color escape character how to use ansi color codes in python ansi color characters ansi color escape code make cmd color ansi characters ansi escape codes java colored background in python ANSI ansi codes python ansi colors in c linux terminal color codes ansi color string escape codes red clor ansi_colored string terminal colours how to add ansi escape codes in java ascii escape code light green color code ansi sequences color picker color ascii codes all console colour codes terminal color coding terminal colors code ansi backgroubd colors terminal ansi colors terminal ubuntu terminal manually enter ansi codes ANSI sequences colo ansi color codes characters escape ascii sequences in python colors colors in terminal console ansi colors escape code color for grey terminal color string generator python ansi color codes color codes linux terminal ansi background 48'5 all terminal colors ascii escape colors terminal colors windows ansi color codes table python ansi colors python ascii colors ansi console codes JAVA ansi sequences color ansi escape code colors ansi color python ansi escape code underline c ansi color codes underline windows color terminal codes ansi color codes go python terminal color ansi color escape codes color escape code count all ANSI escape codes from string yellow ansi code green ansi code all ansi codes red ansi code ljust not working with ANSI escape codes taking contol of the terminal with ansi escape codes ansi code python python ANSI colors escape code python ANSI colour escape code python background ANSI colour codes python ANSI colour codes ansi escape codes colros color codes in ascii c++ ansi color codes terminal text color codes terminal color codes ansi escape codes python terminal escape codes python all ansi escape codes how to use ansi escape values python ansi escape codes bold not working python escape color codes c++ ansi colour codes python reset color escape codes console color codes ansi color code table u"\u001b[ ansi key code python ansi escape sequences ansi color codes python ansi color codes chart ascii color codes ansi code ' python ansi escape move cursor ansi colors python python ansi escape sequences color collection ansi color code generate ansi escape codes ANSI color codes ansi buffer ansi code gotoxy java ansi colors code ansi colors codes ascii colors ansi colors
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source