Blog/scripts/colors.sh

61 lines
1.3 KiB
Bash

#!/usr/bin/env bash
# This script is used to define colors for bash scripts
# Git: https://git.a2s.su/iiiypuk/colors.sh
# Author: Alexander Popov
# License: MIT
# Update: 28 Mar 2024
# Usage:
#
# source colors.sh
# echo -e "This is ${RED}red text${NC}"
# Black and white
export BLACK='\033[0;30m'
export WHITE='\033[0;37m'
export GRAY='\033[0;90m'
export NC='\033[0m' # reset color
# Bold black and white
export BLACK_B='\033[1;30m'
export WHITE_B='\033[1;37m'
export GRAY_B='\033[1;90m'
# Basic colors
export RED='\033[0;31m'
export GREEN='\033[0;32m'
export BLUE='\033[0;34m'
export YELLOW='\033[0;33m'
export MAGENTA='\033[0;35m'
export CYAN='\033[0;36m'
# Bold basic colors
export RED_B='\033[1;31m'
export GREEN_B='\033[1;32m'
export BLUE_B='\033[1;34m'
export YELLOW_B='\033[1;33m'
export MAGENTA_B='\033[1;35m'
export CYAN_B='\033[1;36m'
# Bright colors
export BRIGHT_RED='\033[0;91m'
export BRIGHT_GREEN='\033[0;92m'
export BRIGHT_BLUE='\033[0;94m'
export BRIGHT_YELLOW='\033[0;93m'
export BRIGHT_MAGENTA='\033[0;95m'
export BRIGHT_CYAN='\033[0;96m'
# Bold bright colors
export BRIGHT_RED_B='\033[1;91m'
export BRIGHT_GREEN_B='\033[1;92m'
export BRIGHT_BLUE_B='\033[1;94m'
export BRIGHT_YELLOW_B='\033[1;93m'
export BRIGHT_MAGENTA_B='\033[1;95m'
export BRIGHT_CYAN_B='\033[1;96m'
# Styles
export BOLD='\033[1m'
export UNDERLINE='\033[4m'
export BLINK='\033[5m'