Several terminals even accept full 8-bit RGB color specifications.
$ perl -E 'say "\e[38:2:255:100:80mHello\e[m"' Hello
It can be printed in rgb(255,100,80)
color pink. Depends on your terminal.
As a way to get xterm256 color values ββfrom arbitrary RGB combinations, you might also like Convert::Color
use strict; use warnings; use Convert::Color; use Convert::Color::XTerm; foreach my $hue ( map { $_ * 15 } 0 .. 120/15 ) { my $c = Convert::Color->new( "hsv:$hue,1,1" ); my $index = $c->as_xterm->index; print "\e[38:5:${index}mHue=$hue\e[m\n"; }
I would insert the output here, but it is difficult to convey the colors in the comments :)
source share