TrueColor support
Created by: XVilka
- 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
This means that current support can only display 256 different colours in the terminal, while truecolour means that you can display 16 milion different colours at the same time.
Truecolour escape codes doesnt uses a colour palete. It just specifies the colour itself.
Here's a test case:
printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
- or https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh
- or http://github.com/robertknight/konsole/tree/master/tests/color-spaces.pl
- or https://git.gnome.org/browse/vte/tree/perf/img.sh?h=vte-0-36
- or just run this:
awk 'BEGIN{
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
for (colnum = 0; colnum<77; colnum++) {
r = 255-(colnum*255/76);
g = (colnum*510/76);
b = (colnum*255/76);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "%s\033[0m", substr(s,colnum+1,1);
}
printf "\n";
}'
Keep in mind that it is possible to use both ';' and ':' as parameters delimiter.
See more information here https://gist.github.com/XVilka/8346728