From 30f91d7c8769a68e4bf11ed4ff0177bcf1bc9f03 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Wed, 20 Nov 2024 01:08:30 +0100 Subject: Add gradients --- src/util.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 8d60eb2..78dcad7 100644 --- a/src/util.h +++ b/src/util.h @@ -6,6 +6,7 @@ #include #include #include +#include #define unreachable() log_panic("The impossible happened"); @@ -15,6 +16,12 @@ typedef struct { double r, g, b, a; } color_t; +typedef struct { + color_t *colors; + size_t length; + cairo_pattern_t *cached; +} gradient_t; + static inline color_t color_rgba(int r, int g, int b, int a) { color_t color = { r / 255.0, g / 255.0, b / 255.0, a / 255.0 }; @@ -35,6 +42,10 @@ char *color_to_string(color_t *color); void color_print(FILE *stream, color_t *color); +char *gradient_to_string(gradient_t *gradient); + +void gradient_free(gradient_t *gradient); + const struct timespec timespec_from_ms(long ms); const long timespec_to_ms(struct timespec ts); -- cgit v1.2.3