[Konsole-devel] [Bug 107487] Please add the xterm-256 colour support.
dann at godzilla.ics.uci.edu
dann at godzilla.ics.uci.edu
Tue Feb 21 18:42:18 UTC 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=107487
------- Additional Comments From dann godzilla ics uci edu 2006-02-21 19:42 -------
If someone want to work on this, what needs to be done is to add support
for the ESC;38;5;COLORNUMBERm ESC;$8;5;COLORNUMBERm escape sequences for setting the color background and foreground.
The colors 16 ... 256 can be computed with code like this:
for (r=g=b=0, i=16; i< 256; i++) {
if (i < 232) {
int j = i - 16;
int r = j / 36, g = (j / 6) % 6, b = j % 6;
int red = (r == 0) ? 0 : r * 40 + 55;
int green = (g == 0) ? 0 : g * 40 + 55;
int blue = (b == 0) ? 0 : b * 40 + 55;
color.red = red | red << 8 ;
color.green = green | green << 8;
color.blue = blue | blue << 8;
} else if (i < 256) {
int shade = 8 + (i - 232) * 10;
color.red = color.green = color.blue = shade | shade << 8;
}
The colors 0 ... 16 are in TEWidget.cpp:base_color_table 2...9 and 12...19
More information about the konsole-devel
mailing list