From d367b424d5ad862b6191270c9190aff261d1e581 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Sat, 20 Apr 2024 18:41:45 -0400 Subject: refactored colors initializer --- src/plotting.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/plotting.c') diff --git a/src/plotting.c b/src/plotting.c index 5b5565e..7fb57a8 100644 --- a/src/plotting.c +++ b/src/plotting.c @@ -58,12 +58,14 @@ colors_t* create_colors(const size_t x, const size_t y){ return NULL; } - colors->x = x; - colors->y = y; - colors->size = x*y; - colors->red = red; - colors->green = green; - colors->blue = blue; + *colors = (colors_t){ + .x = x, + .y = y, + .size = x*y, + .red = red, + .green = green, + .blue = blue + }; return colors; } -- cgit v1.2.3