Hello,

how do I get 256 colors in screen running in an 256 enabled xterm?
I tried to create a terminfo entry like this:

screen-256color|screen on xterm with 256 colors,
        ccc,
        colors#256,
        pairs#32767,
        
initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
        setab=\E[48;5;%p1%dm,
        setaf=\E[38;5;%p1%dm,
        setb=\E[48;5;%p1%dm,
        setf=\E[38;5;%p1%dm,
        use=screen-bce,

(stolen from the xterm terminfo).

But the colors are not correct. Especially the colors of the
6 x 6 x 6 color cube (colors 16 - 231) seem to be somehow "rounded".

Attached are (sorry for bw) the correct xterm colors (xterm.png) and
the screen colors (screen.png) with their color numbers. The colors
were generated by a very crude python script (colors.py).

Any help much appreciated.

-- 
Johannes
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# FILE: "/home/joze/colors.py"
# LAST MODIFICATION: "Di, 21 Mär 2006 17:02:41 CET (joze)"
# Copyright (C) 2006 by Johannes Zellner, <[EMAIL PROTECTED]>
# $Id:$

import sys
import os

def echo(msg):
	os.system('echo -n "' + str(msg) + '"')

def out(n):
	os.system("tput setab " + str(n) + "; echo -n " + ("\"% 4d\"" % n))
	os.system("tput setab 0")

# normal colors 1 - 16
for n in range(16):
	out(n)

echo("\n")
echo("\n")

# first three 6 x 6 color layers
#
for y in range(6):

	for z in range(3):

		for x in range(6):

			n = 16 + z * 36 + y * 6 + x
			out(n)

		echo(" ")

	echo("\n")

echo("\n")

# second three 6 x 6 color layers
#
for y in range(6):

	for z in range(3, 6):

		for x in range(6):

			n = 16 + z * 36 + y * 6 + x
			out(n)

		echo(" ")

	echo("\n")

echo("\n")

# gray, first line
for n in range(232, 244):
	out(n)

echo("\n")

# gray, second line
for n in range(244, 256):
	out(n)

echo("\n")

Attachment: xterm.png
Description: PNG image

Attachment: screen.png
Description: PNG image

_______________________________________________
screen-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to