diff options
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -6,6 +6,7 @@ #include <stdbool.h> #include <stdio.h> #include <stdint.h> +#include <cairo.h> #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); |
