Show colors in all possible modes in dump.

This commit is contained in:
2022-06-04 10:12:46 -04:00
parent 79a5382059
commit f4a65f9a8b

View File

@ -70,7 +70,21 @@ function dump_colors()
{
for key in ${!map[@]}
do
printf "%-24s${map[${key}]} |`$0 reset reverse fg:${key}`sample`$0 reset`|\n" ${key}
printf "%-24s${map[${key}]} |" ${key}
printf "`$0 reset reverse fg:${key}`native-sample`$0 reset`|"
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 256 ))
then
printf "`env CSHENV_TERMINAL_COLORS=256 $0 reset reverse fg:${key}`8-bit sample`$0 reset`|"
fi
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 16 ))
then
printf "`env CSHENV_TERMINAL_COLORS=16 $0 reset reverse fg:${key}`4-bit sample`$0 reset`|"
fi
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 8 ))
then
printf "`env CSHENV_TERMINAL_COLORS=8 $0 reset reverse fg:${key}`3-bit sample`$0 reset`|"
fi
printf "\n"
done
exit 0