Lines Matching refs:index
36 static void lookup_colour_ansi(const VTermState *state, long index, VTermColor *col)
38 if(index >= 0 && index < 16) {
39 *col = state->colors[index];
43 static void lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
45 if(index >= 0 && index < 16) {
47 lookup_colour_ansi(state, index, col);
49 else if(index >= 16 && index < 232) {
51 index -= 16;
53 col->blue = ramp6[index % 6];
54 col->green = ramp6[index/6 % 6];
55 col->red = ramp6[index/6/6 % 6];
57 else if(index >= 232 && index < 256) {
59 index -= 232;
61 col->red = ramp24[index];
62 col->green = ramp24[index];
63 col->blue = ramp24[index];
67 static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col, int *index)
81 if(index)
82 *index = CSI_ARG_OR(args[0], -1);
189 void vterm_state_get_palette_color(const VTermState *state, int index, VTermColor *col)
191 lookup_colour_palette(state, index, col);
200 void vterm_state_set_palette_color(VTermState *state, int index, const VTermColor *col)
202 if(index >= 0 && index < 16)
203 state->colors[index] = *col;