From: Michael Tremer Date: Thu, 30 Oct 2025 18:25:44 +0000 (+0000) Subject: graphs: Apply some more styling X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb99f8284dd16f3615d0eb2394334074724c7c51;p=telemetry.git graphs: Apply some more styling Signed-off-by: Michael Tremer --- diff --git a/src/daemon/colors.h b/src/daemon/colors.h index c4898bd..a04f8c3 100644 --- a/src/daemon/colors.h +++ b/src/daemon/colors.h @@ -38,6 +38,18 @@ #define COLOR_PINK "#e91e63" #define COLOR_DEEP_PURPLE "#673ab7" +// Make the background and canvas transparent +#define COLOR_BACKGROUND COLOR_WITH_ALPHA(COLOR_WHITE, COLOR_OPACITY_100P) +#define COLOR_CANVAS COLOR_WITH_ALPHA(COLOR_WHITE, COLOR_OPACITY_100P) + +// Use a dark grey for the font +#define COLOR_FONT "#333333" + +// Use a light grey for the axis, frame and grid +#define COLOR_AXIS "#aaaaaa" +#define COLOR_FRAME "#dddddd" +#define COLOR_GRID "#eeeeee" + /* Define some colours with a special meaning... */ diff --git a/src/daemon/graph.c b/src/daemon/graph.c index 3f1951b..b1a8a15 100644 --- a/src/daemon/graph.c +++ b/src/daemon/graph.c @@ -53,7 +53,22 @@ const char* DEFAULT_RENDER_ARGS[] = { "--", // Change the background color - "--color=BACK" COLOR_WITH_ALPHA(COLOR_WHITE, COLOR_OPACITY_100P), + "--color=BACK" COLOR_BACKGROUND, + + // Change the color of the canvas + "--color=CANVAS" COLOR_CANVAS, + + // Set the font color + "--color=FONT" COLOR_FONT, + + // Set the axis color + "--color=AXIS" COLOR_AXIS, + + // Set the color of the frame + "--color=FRAME" COLOR_FRAME, + + // Set the color of the grid + "--color=GRID" COLOR_GRID, // Disable the border around the image "--border=0",