I'm printing out all the 255 xterm-colors (background) using ANSI extended set background sequences, like so: \033[48;5;%dm
(%d
is substituted from 0-255). I set the xterm window color using #eee9bf
via .Xdefaults
with xrdb
:
XTerm*background: LemonChiffon2
How is it possible that the ANSI colors don't match the #eee9bf
when I inspect visually with a little help from gimp color picker? The xterm color gamut is from 0-255 only, so what is going on here - how is xterm converting #xxxxxx
into 0-255? How does ANSI fit into this?
import sys
bgn_marker = '\033[48;5;%dm '
fgn_marker = '\033[%dm'
end_marker = '\033[0m'
text = "11. hello, how are you - today is not a it;s d'ay"
space = ' ' * 40
def burp(bg):
print '######################## %d ####################################' % bg
for fg in range(30,38):
print (bgn_marker + fgn_marker + text + space + end_marker) % (bg, fg)
(What I'm trying to do is pick a decent background for xterm that doesn't hide the ANSI colors that are often displayed when you use vim/dmesg etc.)