mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-31 12:27:22 +02:00
Adds better color output
This commit is contained in:
parent
e259057496
commit
d258cd3b73
@ -13,20 +13,29 @@ function print-decimal-unicode-range() {
|
|||||||
local count="${continuedCount:-0}"
|
local count="${continuedCount:-0}"
|
||||||
# Use alternating colors to see which symbols extend out of the bounding
|
# Use alternating colors to see which symbols extend out of the bounding
|
||||||
# box.
|
# box.
|
||||||
local bgColor='\x1b[48;2;54;11;0m'
|
#local bgColor='\033[48;2;54;11;0m'
|
||||||
local alternateBgColor='\x1b[48;2;0;54;11m'
|
#local alternateBgColor='\033[48;2;0;54;11m'
|
||||||
|
local bgColorBorder='\033[48;5;8m'
|
||||||
|
local bgColorCode='\033[48;5;246m'
|
||||||
|
local alternateBgColorCode='\033[48;5;240m'
|
||||||
|
local bgColorChar='\033[48;5;66m'
|
||||||
|
local alternateBgColorChar='\033[48;5;60m'
|
||||||
|
local underline='\033[4m'
|
||||||
#local bgColor='\e[48;5;124m%03d'
|
#local bgColor='\e[48;5;124m%03d'
|
||||||
#local alternateBgColor='\e[48;5;202m%03d'
|
#local alternateBgColor='\e[48;5;202m%03d'
|
||||||
local currentColor="${bgColor}"
|
local currentColorCode="${bgColorCode}"
|
||||||
local reset_color='\e[0m'
|
local currentColorChar="${bgColorChar}"
|
||||||
|
local reset_color='\033[0m'
|
||||||
|
|
||||||
local allChars="${currentColor}"
|
#local allChars="${currentColor}"
|
||||||
local allCodes="${currentColor}"
|
#local allCodes="${currentColor}"
|
||||||
|
local allChars=""
|
||||||
|
local allCodes=""
|
||||||
local wrapAt=5
|
local wrapAt=5
|
||||||
local topLine='╔══════╦══════╦══════╦══════╦══════╗'
|
local topLine="${bgColorBorder}╔══════╦══════╦══════╦══════╦══════╗${reset_color}"
|
||||||
local bottomLine='╚══════╩══════╩══════╩══════╩══════╝'
|
local bottomLine="${bgColorBorder}╚══════╩══════╩══════╩══════╩══════╝${reset_color}"
|
||||||
local line='╠══════╬══════╬══════╬══════╬══════╣'
|
local line="${bgColorBorder}╠══════╬══════╬══════╬══════╬══════╣${reset_color}"
|
||||||
local bar='║'
|
local bar="${bgColorBorder}║${reset_color}"
|
||||||
local originalSequence=($(seq "${start}" "${end}"))
|
local originalSequence=($(seq "${start}" "${end}"))
|
||||||
local originalSequenceLength=${#originalSequence[@]}
|
local originalSequenceLength=${#originalSequence[@]}
|
||||||
local leftoverSpaces=$((wrapAt - (originalSequenceLength % wrapAt)))
|
local leftoverSpaces=$((wrapAt - (originalSequenceLength % wrapAt)))
|
||||||
@ -69,8 +78,8 @@ function print-decimal-unicode-range() {
|
|||||||
#echo "IN ELSE char was '$char'"
|
#echo "IN ELSE char was '$char'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
allCodes+=" ${code} $bar"
|
allCodes+="${currentColorCode} ${underline}${code}${reset_color}${currentColorCode} ${reset_color}$bar"
|
||||||
allChars+=" ${char} $bar"
|
allChars+="${currentColorChar} ${char} ${reset_color}$bar"
|
||||||
#echo -e "\ncount was $count"
|
#echo -e "\ncount was $count"
|
||||||
counter=$((counter + 1))
|
counter=$((counter + 1))
|
||||||
count=$(( (count + 1) % wrapAt))
|
count=$(( (count + 1) % wrapAt))
|
||||||
@ -82,24 +91,26 @@ function print-decimal-unicode-range() {
|
|||||||
#printf "║"
|
#printf "║"
|
||||||
#echo -e "\ncount is at zero\n"
|
#echo -e "\ncount is at zero\n"
|
||||||
#echo -e "\nleftoversSpaces is $leftoverSpaces\n"
|
#echo -e "\nleftoversSpaces is $leftoverSpaces\n"
|
||||||
if [[ "${currentColor}" = "${alternateBgColor}" ]]; then
|
if [[ "${currentColorCode}" = "${alternateBgColorCode}" ]]; then
|
||||||
currentColor="${bgColor}"
|
currentColorCode="${bgColorCode}"
|
||||||
|
currentColorChar="${bgColorChar}"
|
||||||
else
|
else
|
||||||
currentColor="${alternateBgColor}"
|
currentColorCode="${alternateBgColorCode}"
|
||||||
|
currentColorChar="${alternateBgColorChar}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
allCodes+="${currentColor}"
|
#allCodes+="${currentColor}"
|
||||||
allChars+="${currentColor}"
|
#allChars+="${currentColor}"
|
||||||
|
|
||||||
printf "%s%b%b" "$bar" "$allCodes" "$reset_color"
|
printf "%b%b%b" "$bar" "$allCodes" "$reset_color"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "%s%b%b" "$bar" "$allChars" "$reset_color"
|
printf "%b%b%b" "$bar" "$allChars" "$reset_color"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
|
||||||
#printf "counter is %s" "$counter"
|
#printf "counter is %s" "$counter"
|
||||||
|
|
||||||
if [ "$counter" != "$sequenceLength" ]; then
|
if [ "$counter" != "$sequenceLength" ]; then
|
||||||
printf "%s\n" $line
|
printf "%b\n" "$line"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
allCodes=""
|
allCodes=""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user