diff options
author | 2016-01-29 11:13:56 +0000 | |
---|---|---|
committer | 2016-01-29 11:13:56 +0000 | |
commit | a4f3e970c6385ca97289df21380e5cb5a6c2a04d (patch) | |
tree | 3b58baceee5bc02085ba0627e76cd4e870249c16 /usr.bin/tmux/tmux.h | |
parent | Simplify code: hasrun is confusing and useless. There is no way (diff) | |
download | wireguard-openbsd-a4f3e970c6385ca97289df21380e5cb5a6c2a04d.tar.xz wireguard-openbsd-a4f3e970c6385ca97289df21380e5cb5a6c2a04d.zip |
Support for RGB colour, using the extended cell mechanism to avoid
wasting unnecessary space. The 'Tc' flag must be set in the external
TERM entry (using terminal-overrides or a custom terminfo entry), if not
tmux will map to the closest of the 256 or 16 colour palettes.
Mostly from Suraj N Kurapati, based on a diff originally by someone else.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r-- | usr.bin/tmux/tmux.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 9c7c8745bb6..7ecd9555072 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.618 2016/01/19 16:01:30 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.619 2016/01/29 11:13:56 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -385,6 +385,7 @@ enum tty_code_code { TTYC_SMSO, /* enter_standout_mode, so */ TTYC_SMUL, /* enter_underline_mode, us */ TTYC_SS, /* set cursor style, Ss */ + TTYC_TC, /* 24-bit "true" colour, Tc */ TTYC_TSL, /* to_status_line, tsl */ TTYC_VPA, /* row_address, cv */ TTYC_XENL, /* eat_newline_glitch, xn */ @@ -641,16 +642,31 @@ enum utf8_state { #define GRID_FLAG_BG256 0x2 #define GRID_FLAG_PADDING 0x4 #define GRID_FLAG_EXTENDED 0x8 +#define GRID_FLAG_FGRGB 0x10 +#define GRID_FLAG_BGRGB 0x20 /* Grid line flags. */ #define GRID_LINE_WRAPPED 0x1 +/* Grid cell RGB colours. */ +struct grid_cell_rgb { + u_char r; + u_char g; + u_char b; +}; + /* Grid cell data. */ struct grid_cell { u_char flags; u_char attr; - u_char fg; - u_char bg; + union { + u_char fg; + struct grid_cell_rgb fg_rgb; + }; + union { + u_char bg; + struct grid_cell_rgb bg_rgb; + }; struct utf8_data data; }; |