scwrypts/zsh/utils/colors.zsh
yage 244c188deb v2.5.2
=====================================================================

--- Changes ------------------------------

- added __GET_RANDOM_COLOR for funsies
2022-08-16 23:29:10 -06:00

45 lines
677 B
Bash

__BLACK='\033[0;30m'
__DARK_GRAY='\033[1;30m'
__RED='\033[0;31m'
__LIGHT_RED='\033[1;31m'
__GREEN='\033[0;32m'
__LIGHT_GREEN='\033[1;32m'
__ORANGE='\033[0;33m'
__YELLOW='\033[1;33m'
__BLUE='\033[1;34m'
__DARK_BLUE='\033[0;34m'
__PURPLE='\033[1;35m'
__DARK_PURPLE='\033[0;35m'
__CYAN='\033[1;36m'
__DARK_CYAN='\033[0;36m'
__WHITE='\033[1;37m'
__LIGHT_GRAY='\033[0;37m'
__COLOR_RESET='\033[0m'
__GET_RANDOM_COLOR() {
local COLORS=(
$__RED
$__LIGHT_RED
$__GREEN
$__LIGHT_GREEN
$__ORANGE
$__YELLOW
$__BLUE
$__DARK_BLUE
$__PURPLE
$__DARK_PURPLE
$__CYAN
$__DARK_CYAN
$__WHITE
)
print "$__COLOR_RESET${COLORS[$(shuf -i 1-${#COLORS[@]} -n 1)]}"
}