Clean up greys a bit, due to 16-base colours being user-mapped.
This commit is contained in:
@ -59,6 +59,8 @@ map[vga-brightmagenta]="ff55ff"
|
|||||||
map[vga-brightcyan]="55ffff"
|
map[vga-brightcyan]="55ffff"
|
||||||
map[vga-brightwhite]="ffffff"
|
map[vga-brightwhite]="ffffff"
|
||||||
|
|
||||||
|
enable_greyscale_cheat=0
|
||||||
|
|
||||||
nocsi=0
|
nocsi=0
|
||||||
if [[ $1 == "no-csi" ]]
|
if [[ $1 == "no-csi" ]]
|
||||||
then
|
then
|
||||||
@ -70,19 +72,24 @@ function dump_colors()
|
|||||||
{
|
{
|
||||||
for key in ${!map[@]}
|
for key in ${!map[@]}
|
||||||
do
|
do
|
||||||
|
case $key in
|
||||||
|
*bright*) text_color="000000" ;;
|
||||||
|
*black*) text_color="ffffff" ;;
|
||||||
|
*) text_color="000000" ;;
|
||||||
|
esac
|
||||||
printf "%-24s${map[${key}]} |" ${key}
|
printf "%-24s${map[${key}]} |" ${key}
|
||||||
printf "`$0 reset reverse fg:${key}`native-sample`$0 reset`|"
|
printf "`$0 reset reverse bg:${text_color} fg:${key}`native-sample`$0 reset`|"
|
||||||
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 256 ))
|
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 256 ))
|
||||||
then
|
then
|
||||||
printf "`env CSHENV_TERMINAL_COLORS=256 $0 reset reverse fg:${key}`8-bit sample`$0 reset`|"
|
printf "`env CSHENV_TERMINAL_COLORS=256 $0 reset reverse bg:${text_color} fg:${key}`8-bit sample`$0 reset`|"
|
||||||
fi
|
fi
|
||||||
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 16 ))
|
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 16 ))
|
||||||
then
|
then
|
||||||
printf "`env CSHENV_TERMINAL_COLORS=16 $0 reset reverse fg:${key}`4-bit sample`$0 reset`|"
|
printf "`env CSHENV_TERMINAL_COLORS=16 $0 reset reverse bg:${text_color} fg:${key}`4-bit sample`$0 reset`|"
|
||||||
fi
|
fi
|
||||||
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 8 ))
|
if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 8 ))
|
||||||
then
|
then
|
||||||
printf "`env CSHENV_TERMINAL_COLORS=8 $0 reset reverse fg:${key}`3-bit sample`$0 reset`|"
|
printf "`env CSHENV_TERMINAL_COLORS=8 $0 reset reverse bg:${text_color} fg:${key}`3-bit sample`$0 reset`|"
|
||||||
fi
|
fi
|
||||||
printf "\n"
|
printf "\n"
|
||||||
done
|
done
|
||||||
@ -289,6 +296,8 @@ function rgb_color()
|
|||||||
echo "Computed 256 color choice, after applying greyscale scan: " ${ext_8_bit}
|
echo "Computed 256 color choice, after applying greyscale scan: " ${ext_8_bit}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if (( ${enable_greyscale_cheat} ))
|
||||||
|
then
|
||||||
# Check for SPECIFIC white and black and grey:
|
# Check for SPECIFIC white and black and grey:
|
||||||
# The half-saturation, no saturation, and full saturation values are mapped
|
# The half-saturation, no saturation, and full saturation values are mapped
|
||||||
# to specific points in the legacy set. (This may be ill-advised as a manually
|
# to specific points in the legacy set. (This may be ill-advised as a manually
|
||||||
@ -313,6 +322,7 @@ function rgb_color()
|
|||||||
ext_8_bit=7
|
ext_8_bit=7
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if (( ${debug} ))
|
if (( ${debug} ))
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user