summaryrefslogtreecommitdiffstats
path: root/sys/teken/teken.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-09-26 15:26:32 +0000
committered <ed@FreeBSD.org>2009-09-26 15:26:32 +0000
commitb69a48a63f54bfcc1c9b1bf8a8828fbaf25e004b (patch)
tree33e925a77e9fa035d0525a951f7a87e23f46271e /sys/teken/teken.h
parentba94d1a005032941ea59b2f361257e1cbd4fa6bd (diff)
downloadFreeBSD-src-b69a48a63f54bfcc1c9b1bf8a8828fbaf25e004b.zip
FreeBSD-src-b69a48a63f54bfcc1c9b1bf8a8828fbaf25e004b.tar.gz
Add 256 color support.
It is quite inconvenient that if an application for xterm uses 256 color mode, text suddenly starts to blink (because of ;5; in the middle). We'd better just implement 256 color mode and add a conversion routine from 256 to 8 color mode, which doesn't seem to be too bad in practice. Remapping colors is done quite simple. If one of the channels is most actively represented, primary colors are used. If two channels are most actively represented, secondary colors are used. If all three channels are equal (gray), it picks between black and white. Reported by: Paul B. Mahol <onemda gmail com>
Diffstat (limited to 'sys/teken/teken.h')
-rw-r--r--sys/teken/teken.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/teken/teken.h b/sys/teken/teken.h
index 4e73f7b..aab037f 100644
--- a/sys/teken/teken.h
+++ b/sys/teken/teken.h
@@ -171,4 +171,7 @@ void teken_set_winsize(teken_t *, const teken_pos_t *);
void teken_set_8bit(teken_t *);
void teken_set_cons25(teken_t *);
+/* Color conversion. */
+teken_color_t teken_256to8(teken_color_t);
+
#endif /* !_TEKEN_H_ */
OpenPOWER on IntegriCloud