climenu supports basic ANSI colors, including foreground, background, and bright.


Windows may have some strange affects when using ANSI formatting codes. It may not always work! YMMV


There’s no way of knowing what color scheme your users are using in thier terminal. It’s best to use colors sparingly, and perhaps always define a background.

ANSI Color Table

You can read more about the ANSI color table on wikipedia

The supported colors are: black, red, green, yellow, blue, magenta, cyan, and white.

Using Colors

You can use the colors by wrapping some text with the color codes. This is done using the climenu.colors object.

import climenu

# Print red text on the default background.
print("Hello World!")


The functions in climenu.colors.* return strings that contain the ANSI codes needed to format your text. This also means that you can nest these calls, or make multiple calls to create multi-formatted strings (e.g. bright-blue text on a yellow background).

import climenu

# Print bright-blue text on a yellow background
    climenu.colors.yellow("Hello World!", bright=True),

# Another way to do it
text ="Hello World!", bright=True)
text = climenu.colors.yellow(text, bg=True)

Disabling Colors

You can disable colors completely by using climenu.settings.disable_colors = True in your code. This would only be needed in cases where you are using colors in some parts of the code, but you know you are running on a platform that doesn’t support ANSI color codes.

Why is “yellow” showing up as orange?

That threw me too… A short explaination is given on wikipedia. If any of this make sense to you, good on ya!

On terminals based on CGA compatible hardware, such as ANSI.SYS running on DOS, this normal intensity foreground color is rendered as Orange. CGA RGBI monitors contained hardware to modify the dark yellow color to an orange/brown color by reducing the green component