[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
terminfo entries for color wrong/incorrect.
From: |
L A Walsh |
Subject: |
terminfo entries for color wrong/incorrect. |
Date: |
Sat, 13 May 2017 14:56:06 -0700 |
User-agent: |
Thunderbird |
I wanted to find numbers of colors supported by various term-emulators
on my system.
When I tried xterm and ones listed for full color, most returned '8',
with a few @ 256, but none returned full color (2^24 = 16 * 1024 * 1024).
Also none of the linux entries returned more than 16, but the
linux console supports, at least 256 at a time (out of a 24-bit pallete).
I tried xterm as well, but it returned 8, when I can run an
xterm-colors.pl program that shows 216 colors (attached @ end).
So how what's up... why are values from terminfo showing such limited
values?
Thanks..
linda
---:xterm-colors.pl:-----
#!/usr/bin/perl -w
use strict;
use constant xreset => "\x1b[0m";
sub xreset_print() { print xreset; }
sub xrgb6 (@) { # take r,g,b,bkflg OR "#RGB",bkflg bkflg=bool
use integer;
my ($r, $g, $b, $c, $bkg);
if (@_>2) { ($r, $g, $b, $bkg)address@hidden; }
else {
($c, $bkg)address@hidden;
$b = $c%8; $c/=8;
$g = $c%8;
$r = $c/8;
}
"\x1b[" . ($bkg?"48":"38") .";5;". (16+6*(6*$r + $g)+$b). "m";
}
sub xrgb6_print (@) { printf xrgb6(@_) }
sub xrgb6_text($$;@) {
my $rgb = shift;
xrgb6_print(@$rgb);
printf @_;
xreset_print();
}
for my $b (0..5) {
for my $r (0..5) {
for my $g (0..5) {
xrgb6_text([$r*64+$g*8+$b],"%d%d%d",$r,$g,$b) }}
print "\n"
}
- terminfo entries for color wrong/incorrect.,
L A Walsh <=