36 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF,
40 0x00, 0x0B, 0x16, 0x21, 0x2C, 0x37, 0x42, 0x4D, 0x58, 0x63, 0x6E, 0x79,
41 0x85, 0x90, 0x9B, 0xA6, 0xB1, 0xBC, 0xC7, 0xD2, 0xDD, 0xE8, 0xF3, 0xFF,
46 if (idx >= 0 && idx < 16) {
55 if(index >= 0 && index < 16) {
65 if(index >= 0 && index < 16) {
69 else if(index >= 16 && index < 232) {
79 else if(index >= 232 && index < 256) {
104 return argcount ? 1 : 0;
109 return argcount ? 1 : 0;
112 DEBUG_LOG(
"Unrecognised colour palette %d\n", palette);
123 DEBUG_LOG(
"Cannot set attr %d as it has type %d, not type %d\n",
166 for(
int col = 0; col < 16; col++)
223 return (a->
rgb.red == b->
rgb.red)
224 && (a->
rgb.green == b->
rgb.green)
225 && (a->
rgb.blue == b->
rgb.blue);
259 if(index >= 0 && index < 16)
283 while(argi < argcount) {
289 switch(arg =
CSI_ARG(args[argi])) {
351 case 10:
case 11:
case 12:
case 13:
case 14:
352 case 15:
case 16:
case 17:
case 18:
case 19:
397 case 30:
case 31:
case 32:
case 33:
398 case 34:
case 35:
case 36:
case 37:
399 value =
CSI_ARG(args[argi]) - 30;
406 if(argcount - argi < 1)
417 case 40:
case 41:
case 42:
case 43:
418 case 44:
case 45:
case 46:
case 47:
419 value =
CSI_ARG(args[argi]) - 40;
424 if(argcount - argi < 1)
447 case 90:
case 91:
case 92:
case 93:
448 case 94:
case 95:
case 96:
case 97:
449 value =
CSI_ARG(args[argi]) - 90 + 8;
453 case 100:
case 101:
case 102:
case 103:
454 case 104:
case 105:
case 106:
case 107:
455 value =
CSI_ARG(args[argi]) - 100 + 8;
465 DEBUG_LOG(
"libvterm: Unhandled CSI SGR %ld\n", arg);
483 args[argi++] = (idx + (fg ? 30 : 40));
486 args[argi++] = (idx - 8 + (fg ? 90 : 100));
499 args[argi++] = col->
rgb.blue;
static VTermState * state
enum MessageType type
Type of the message.
INTERNAL void vterm_state_savepen(VTermState *state, int save)
static void setpenattr_bool(VTermState *state, VTermAttr attr, int boolean)
void vterm_state_set_palette_color(VTermState *state, int index, const VTermColor *col)
static void lookup_default_colour_ansi(long idx, VTermColor *col)
void vterm_state_get_palette_color(const VTermState *state, int index, VTermColor *col)
static bool lookup_colour_ansi(const VTermState *state, long index, VTermColor *col)
void vterm_state_set_bold_highbright(VTermState *state, int bold_is_highbright)
void vterm_state_get_default_colors(const VTermState *state, VTermColor *default_fg, VTermColor *default_bg)
INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount)
INTERNAL void vterm_state_resetpen(VTermState *state)
static void setpenattr(VTermState *state, VTermAttr attr, VTermValueType type, VTermValue *val)
static const VTermRGB ansi_colors[]
void vterm_state_convert_color_to_rgb(const VTermState *state, VTermColor *col)
void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg)
INTERNAL void vterm_state_newpen(VTermState *state)
static int vterm_state_getpen_color(const VTermColor *col, int argi, long args[], int fg)
int vterm_state_get_penattr(const VTermState *state, VTermAttr attr, VTermValue *val)
static bool lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
static void set_pen_col_ansi(VTermState *state, VTermAttr attr, long col)
static void setpenattr_int(VTermState *state, VTermAttr attr, int number)
static void setpenattr_col(VTermState *state, VTermAttr attr, VTermColor color)
int vterm_color_is_equal(const VTermColor *a, const VTermColor *b)
static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col)
INTERNAL void vterm_state_setpen(VTermState *state, const long args[], int argcount)
int(* setpenattr)(VTermAttr attr, VTermValue *val, void *user)
const VTermStateCallbacks * callbacks
struct VTermState::@17 saved
struct VTermColor::@11 indexed
#define VTERM_COLOR_IS_INDEXED(col)
static void vterm_color_rgb(VTermColor *col, uint8_t red, uint8_t green, uint8_t blue)
#define CSI_ARG_HAS_MORE(a)
#define VTERM_COLOR_IS_DEFAULT_FG(col)
#define VTERM_COLOR_IS_RGB(col)
VTermValueType vterm_get_attr_type(VTermAttr attr)
#define CSI_ARG_IS_MISSING(a)
#define CSI_ARG_FLAG_MORE
static void vterm_color_indexed(VTermColor *col, uint8_t idx)
#define VTERM_COLOR_IS_DEFAULT_BG(col)
struct VTermColor::@10 rgb