diff --git a/kitty/colors.c b/kitty/colors.c index 37e25df82..d1250e069 100644 --- a/kitty/colors.c +++ b/kitty/colors.c @@ -177,7 +177,7 @@ patch_color_profiles(PyObject *module UNUSED, PyObject *args) { } DynamicColor -colorprofile_to_color(ColorProfile *self, DynamicColor entry, DynamicColor defval) { +colorprofile_to_color(const ColorProfile *self, DynamicColor entry, DynamicColor defval) { switch(entry.type) { case COLOR_NOT_SET: return defval; diff --git a/kitty/data-types.h b/kitty/data-types.h index 782d9f115..f09c3bdb5 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -403,7 +403,7 @@ bool schedule_write_to_child(unsigned long id, unsigned int num, ...); bool schedule_write_to_child_python(unsigned long id, const char *prefix, PyObject* tuple_of_str_or_bytes, const char *suffix); bool set_iutf8(int, bool); -DynamicColor colorprofile_to_color(ColorProfile *self, DynamicColor entry, DynamicColor defval); +DynamicColor colorprofile_to_color(const ColorProfile *self, DynamicColor entry, DynamicColor defval); color_type colorprofile_to_color_with_fallback(ColorProfile *self, DynamicColor entry, DynamicColor defval, DynamicColor fallback, DynamicColor falback_defval); void copy_color_table_to_buffer(ColorProfile *self, color_type *address, int offset, size_t stride); diff --git a/kitty/line.c b/kitty/line.c index 8b2910ada..0ff98e085 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -614,7 +614,7 @@ left_shift(Line *self, PyObject *args) { } static color_type -resolve_color(ColorProfile *cp, color_type val, color_type defval) { +resolve_color(const ColorProfile *cp, color_type val, color_type defval) { switch(val & 0xff) { case 1: return cp->color_table[(val >> 8) & 0xff]; @@ -626,7 +626,7 @@ resolve_color(ColorProfile *cp, color_type val, color_type defval) { } bool -colors_for_cell(Line *self, ColorProfile *cp, index_type *x, color_type *fg, color_type *bg, bool *reversed) { +colors_for_cell(Line *self, const ColorProfile *cp, index_type *x, color_type *fg, color_type *bg, bool *reversed) { if (*x >= self->xnum) return false; if (*x > 0 && !self->gpu_cells[*x].attrs.width && self->gpu_cells[*x-1].attrs.width == 2) (*x)--; *fg = resolve_color(cp, self->gpu_cells[*x].fg, *fg); diff --git a/kitty/lineops.h b/kitty/lineops.h index 241e34ac1..aa4c25d41 100644 --- a/kitty/lineops.h +++ b/kitty/lineops.h @@ -132,4 +132,4 @@ void historybuf_clear(HistoryBuf *self); void mark_text_in_line(PyObject *marker, Line *line); bool line_has_mark(Line *, uint16_t mark); PyObject* as_text_generic(PyObject *args, void *container, get_line_func get_line, index_type lines, ANSIBuf *ansibuf, bool add_trailing_newline); -bool colors_for_cell(Line *self, ColorProfile *cp, index_type *x, color_type *fg, color_type *bg, bool *reversed); +bool colors_for_cell(Line *self, const ColorProfile *cp, index_type *x, color_type *fg, color_type *bg, bool *reversed); diff --git a/kitty/shaders.c b/kitty/shaders.c index 58b7bda1a..1e50c8435 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -275,7 +275,7 @@ create_graphics_vao(void) { #define IS_SPECIAL_COLOR(name) (screen->color_profile->overridden.name.type == COLOR_IS_SPECIAL || (screen->color_profile->overridden.name.type == COLOR_NOT_SET && screen->color_profile->configured.name.type == COLOR_IS_SPECIAL)) static void -pick_cursor_color(Line *line, ColorProfile *color_profile, color_type cell_fg, color_type cell_bg, index_type cell_color_x, color_type *cursor_fg, color_type *cursor_bg, color_type default_fg, color_type default_bg) { +pick_cursor_color(Line *line, const ColorProfile *color_profile, color_type cell_fg, color_type cell_bg, index_type cell_color_x, color_type *cursor_fg, color_type *cursor_bg, color_type default_fg, color_type default_bg) { ARGB32 fg, bg, dfg, dbg; (void) line; (void) color_profile; (void) cell_color_x; fg.rgb = cell_fg; bg.rgb = cell_bg;