mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
66 lines
2 KiB
Bash
66 lines
2 KiB
Bash
# defaults
|
|
local Z="\[\033[0m\]" # reset (zero) all attributes
|
|
local N="\[\033[0;39m\]" # reset fg to default (none)
|
|
local BGN="\[\033[0;49m\]" # reset bg to default (none)
|
|
|
|
# normal colors
|
|
local K="\[\033[30m\]" # black
|
|
local R="\[\033[31m\]" # red
|
|
local G="\[\033[32m\]" # green
|
|
local Y="\[\033[33m\]" # yellow
|
|
local B="\[\033[34m\]" # blue
|
|
local M="\[\033[35m\]" # magenta
|
|
local C="\[\033[36m\]" # cyan
|
|
local W="\[\033[37m\]" # white
|
|
|
|
# bright/bold colors
|
|
local BK="\[\033[1;30m\]" # black
|
|
local BR="\[\033[1;31m\]" # red
|
|
local BG="\[\033[1;32m\]" # greed
|
|
local BY="\[\033[1;33m\]" # yellow
|
|
local BB="\[\033[1;34m\]" # blue
|
|
local BM="\[\033[1;35m\]" # magenta
|
|
local BC="\[\033[1;36m\]" # cyan
|
|
local BW="\[\033[1;37m\]" # white
|
|
|
|
# normal background colors
|
|
local BGK="\[\033[40m\]" # black
|
|
local BGR="\[\033[41m\]" # red
|
|
local BGG="\[\033[42m\]" # green
|
|
local BGY="\[\033[43m\]" # yellow
|
|
local BGB="\[\033[44m\]" # blue
|
|
local BGM="\[\033[45m\]" # magenta
|
|
local BGC="\[\033[46m\]" # cyan
|
|
local BGW="\[\033[47m\]" # white
|
|
|
|
# transform color variables, if asked
|
|
for var in $color_vars; do
|
|
case "${!var}" in
|
|
"black") declare $var="$K";;
|
|
"red") declare $var="$R";;
|
|
"green") declare $var="$G";;
|
|
"yellow") declare $var="$Y";;
|
|
"blue") declare $var="$B";;
|
|
"magenta") declare $var="$M";;
|
|
"cyan") declare $var="$C";;
|
|
"white") declare $var="$W";;
|
|
"default") declare $var="$N";;
|
|
esac
|
|
done
|
|
|
|
# transform background color variables, if asked
|
|
for var in $bg_color_vars; do
|
|
case "${!var}" in
|
|
"black") declare $var="$BGK";;
|
|
"red") declare $var="$BGR";;
|
|
"green") declare $var="$BGG";;
|
|
"yellow") declare $var="$BGY";;
|
|
"blue") declare $var="$BGB";;
|
|
"magenta") declare $var="$BGM";;
|
|
"cyan") declare $var="$BGC";;
|
|
"white") declare $var="$BGW";;
|
|
"default") declare $var="$BGN";;
|
|
esac
|
|
done
|
|
|
|
# vim: ft=sh
|