Files
crossover/rainbow.sh
2022-11-14 15:43:14 +01:00

52 lines
698 B
Bash

# https://github.com/xr09/rainbow.sh
# Bash helper functions to put colors on your scripts
#
# Usage example:
# vargreen=$(echogreen "Grass is green")
# echo "Coming next: $vargreen"
#
__RAINBOWPALETTE="1"
function __colortext()
{
echo -e " \e[$__RAINBOWPALETTE;$2m$1\e[0m"
}
function echogreen()
{
echo $(__colortext "$1" "32")
}
function echored()
{
echo $(__colortext "$1" "31")
}
function echoblue()
{
echo $(__colortext "$1" "34")
}
function echopurple()
{
echo $(__colortext "$1" "35")
}
function echoyellow()
{
echo $(__colortext "$1" "33")
}
function echocyan()
{
echo $(__colortext "$1" "36")
}
function echowhite()
{
echo $(__colortext "$1" "37")
}