Last active
October 29, 2024 18:24
-
-
Save imshvc/00d0e4844fd651e3fe4cf31c4dc50fbd to your computer and use it in GitHub Desktop.
Command Prompt Batch Colors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem -- console colors for batch scripts -- | |
rem You can set these to empty variables | |
rem if you don't want colored output, or | |
rem set NO_COLOR env var to a non-empty | |
rem value | |
rem Control Codes | |
set CLR_RESET=[0m | |
set CLR_BOLD=[1m | |
set CLR_UNDERLINE=[4m | |
set CLR_NEGATIVE=[7m | |
set CLR_NOUNDERLINE=[24m | |
set CLR_POSITIVE=[27m | |
rem Colors (foreground) | |
set CLR_BLACK=[30m | |
set CLR_RED=[31m | |
set CLR_GREEN=[32m | |
set CLR_YELLOW=[33m | |
set CLR_BLUE=[34m | |
set CLR_PURPLE=[35m | |
set CLR_LBLUE=[36m | |
set CLR_WHITE=[37m | |
rem Colors (foreground, bright) | |
set CLR_BLACK2=[90m | |
set CLR_RED2=[91m | |
set CLR_GREEN2=[92m | |
set CLR_YELLOW2=[93m | |
set CLR_BLUE2=[94m | |
set CLR_PURPLE2=[95m | |
set CLR_LBLUE2=[96m | |
set CLR_WHITE2=[97m | |
rem Colors (background) | |
set CLR_BBLACK=[40m | |
set CLR_BRED=[41m | |
set CLR_BGREEN=[42m | |
set CLR_BYELLOW=[43m | |
set CLR_BBLUE=[44m | |
set CLR_BPURPLE=[45m | |
set CLR_BLBLUE=[46m | |
set CLR_BWHITE=[47m | |
rem Colors (background, bright) | |
set CLR_BBLACK2=[100m | |
set CLR_BRED2=[101m | |
set CLR_BGREEN2=[102m | |
set CLR_BYELLOW2=[103m | |
set CLR_BBLUE2=[104m | |
set CLR_BPURPLE2=[105m | |
set CLR_BLBLUE2=[106m | |
set CLR_BWHITE2=[107m | |
rem Colors for logging | |
set CLR_DEBUG=[38;2;255;64;64m | |
set CLR_PASS=[38;2;0;255;0m | |
set CLR_FAIL=[38;2;255;0;0m | |
set CLR_WARN=[38;2;255;128;0m | |
set CLR_INFO=[38;2;255;255;0m | |
rem Disable colors if "NO_COLOR" variable set | |
rem See: https://no-color.org/ | |
if "%NO_COLOR%" neq "" ( | |
rem Control Codes | |
set CLR_RESET= | |
set CLR_BOLD= | |
set CLR_UNDERLINE= | |
set CLR_NEGATIVE= | |
set CLR_NOUNDERLINE= | |
set CLR_POSITIVE= | |
rem Colors (foreground) | |
set CLR_BLACK= | |
set CLR_RED= | |
set CLR_GREEN= | |
set CLR_YELLOW= | |
set CLR_BLUE= | |
set CLR_PURPLE= | |
set CLR_LBLUE= | |
set CLR_WHITE= | |
rem Colors (foreground, bright) | |
set CLR_BLACK2= | |
set CLR_RED2= | |
set CLR_GREEN2= | |
set CLR_YELLOW2= | |
set CLR_BLUE2= | |
set CLR_PURPLE2= | |
set CLR_LBLUE2= | |
set CLR_WHITE2= | |
rem Colors (background) | |
set CLR_BBLACK= | |
set CLR_BRED= | |
set CLR_BGREEN= | |
set CLR_BYELLOW= | |
set CLR_BBLUE= | |
set CLR_BPURPLE= | |
set CLR_BLBLUE= | |
set CLR_BWHITE= | |
rem Colors for logging | |
set CLR_DEBUG= | |
set CLR_PASS= | |
set CLR_FAIL= | |
set CLR_WARN= | |
set CLR_INFO= | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment