Check if terminal supports 24-bit / true color
This source says to check if $COLORTERM
contains 24bit
or truecolor
.
sh
[ "$COLORTERM" = truecolor ] || [ "$COLORTERM" = 24bit ]
bash
/ zsh
:
[[ $COLORTERM =~ ^(truecolor|24bit)$ ]]