diff options
| author | Federico Angelilli <code@fedang.net> | 2024-07-11 23:09:27 +0200 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-07-11 23:09:27 +0200 |
| commit | 32aa49a2299ea2bf95b72631dfafac7090c3c6e9 (patch) | |
| tree | aabbce5a27059f293fc34e5fd3239fcf0b496623 /src/util.h | |
| parent | 60739263729e36f99b4c9279447c622acd3bd04c (diff) | |
Print color
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -4,6 +4,7 @@ #include <time.h> #include <stddef.h> #include <stdbool.h> +#include <stdio.h> // Color representation normalized to [0, 1] // @@ -22,11 +23,15 @@ static inline color_t color_rgb(int r, int g, int b) return color_rgba(r, g, b, 255); } +char *color_to_string(color_t *color); + +void color_print(FILE *stream, color_t *color); + struct timespec timespec_diff(struct timespec a, struct timespec b); bool timespec_greater(struct timespec a, struct timespec b); -void timespec_print(struct timespec *ts); +void timespec_print(FILE *stream, struct timespec *ts); // Check if point (px, py) is inside a rectangle in (x, y), (x+w, y), (x, y+h) and (w+h, y+h) bool check_rect(int px, int py, int x, int y, int w, int h); |
