Color swatches mode for __build_sgr_code
This commit is contained in:
+23
-1
@@ -194,6 +194,21 @@ color_chart()
|
||||
greyscale_chart
|
||||
}
|
||||
|
||||
color_block()
|
||||
{
|
||||
printf "\e[37;1;48;5;${1}m%3i\e[m " ${1}
|
||||
}
|
||||
|
||||
color_swatches()
|
||||
{
|
||||
while [ "$1" != "" ]
|
||||
do
|
||||
color_block $1
|
||||
shift 1
|
||||
done
|
||||
printf "\n"
|
||||
}
|
||||
|
||||
setup_color_depth()
|
||||
{
|
||||
use_8_bit=0
|
||||
@@ -544,11 +559,18 @@ build_sgr_code()
|
||||
}
|
||||
|
||||
output=""
|
||||
while [ ! -z $1 ]
|
||||
|
||||
if [ "$1" = "color-swatches" ]
|
||||
then
|
||||
shift 1
|
||||
color_swatches $*
|
||||
else
|
||||
while [ ! -z "$1" ]
|
||||
do
|
||||
build_sgr_code $1
|
||||
shift 1
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ! -z "${output}" ] && [ ${nocsi} -ne 1 ]
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user