This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/common/colors/vconsole

49 lines
659 B
Text
Raw Normal View History

#!/bin/sh
2021-07-04 11:01:15 -05:00
black="111111" # black
red="f92672" # red
green="a6e22e" # green
yellow="f4bf75" # yellow
blue="66d9ef" # blue
magenta="ae81ff" # magenta
cyan="a1efe4" # cyan
white="cccccc" # white
black2="75715e" # black2
white2="f8f8f8" # white2
2021-07-04 11:01:15 -05:00
c() {
c="${1}"; shift
for n in "$@"; do
printf "\e]P%d%s" "$n" "$c";
2021-07-04 11:01:15 -05:00
done
}
c $black 0
c $red 1 9
c $green 2 A
c $yellow 3 B
c $blue 4 C
c $magenta 5 D
c $cyan 6 E
c $white 7
c $black2 8
c $white2 F
if [ -x /sbin/clear ]; then
/sbin/clear
else
printf "\e[H\e[2J"
fi
2021-07-04 11:01:15 -05:00
unset -f c
unset black
unset red
unset green
unset yellow
unset blue
unset magenta
unset cyan
unset white
unset black2
unset white2