Files
scripts/ansi_colors.sh
2026-09-29 15:24:09 -04:00

35 lines
771 B
Bash

# This script is meant to be sourced in other scripts to make colorizing easier.
# It should not be made executable and run stand-alone.
# Set Select Graphic Rendition (SGR)
GROFF_NO_SGR=1
# Modifiers
RESET=$'\e[0m'
BOLD=$'\e[1m' # also used as bright
DIM=$'\e[2m'
UNDERLINE=$'\e[4m'
BLINK=$'\e[5m' # this may not work in all terminals
INVERT=$'\e[7m' # swaps background and foreground colors
# Foreground colors
FG_BLACK=$'\e[0;30m'
FG_RED=$'\e[0;31m'
FG_GREEN=$'\e[0;32m'
FG_YELLOW=$'\e[0;33m'
FG_BLUE=$'\e[0;34m'
FG_MAGENTA=$'\e[0;35m'
FG_CYAN=$'\e[0;36m'
FG_WHITE=$'\e[0;37m'
# Background colors
BG_BLACK=$'\e[40m'
BG_RED=$'\e[41m'
BG_GREEN=$'\e[42m'
BG_YELLOW=$'\e[43m'
BG_BLUE=$'\e[44m'
BG_MAGENTA=$'\e[45m'
BG_CYAN=$'\e[46m'
BG_WHITE=$'\e[47m'