]> git.ipfire.org Git - oddments/collecty.git/commitdiff
colors: Define a special color for rx/tx traffic
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Oct 2025 14:12:50 +0000 (14:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Oct 2025 14:12:50 +0000 (14:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/colors.h
src/daemon/graphs/graph.h
src/daemon/graphs/hostapd-station-rate-info.c

index 3ee5b85670896b71908bef70b8b67bbe8ee5eacb..09577ce2848e9558720e863798138659206e0a2d 100644 (file)
 // Limit - When there is a ceiling to resource usage
 #define LIMIT                  RED
 
+// Define colors for incoming/outgoing traffic
+#define COLOR_RX               GREEN
+#define COLOR_TX               RED
+
 // Macro to make colours transparent
 #define COLOR_WITH_ALPHA(base, alpha) base alpha
 
index b175314291c375a4ac14ed6c3b754dff7a4ef14a..dc51b7290431dfe0709406696fd0bb29aff5ee20 100644 (file)
        } while (0)
 
 #define DRAW_BANDWIDTH_INCOMING(args, object, rx_bytes) \
-       __DRAW_BANDWIDTH(args, object, rx_bytes, GREEN, _("Incoming Traffic"))
+       __DRAW_BANDWIDTH(args, object, rx_bytes, COLOR_RX, _("Incoming Traffic"))
 
 #define DRAW_BANDWIDTH_OUTGOING(args, object, tx_bytes) \
-       __DRAW_BANDWIDTH(args, object, tx_bytes, RED, _("Outgoing Traffic"))
+       __DRAW_BANDWIDTH(args, object, tx_bytes, COLOR_TX, _("Outgoing Traffic"))
 
 #define __DRAW_BANDWIDTH(args, object, bytes, color, label) \
        do { \
index a94c93f580d9817a5a20ffabfd418f571d3a0123..7a5c208b1f24d1e02e4cf280cdfc046e91be2cab 100644 (file)
@@ -47,11 +47,11 @@ static int hostapd_station_rate_info_render(td_ctx* ctx,
        PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
 
        // Receive Rate
-       DRAW_LINE2_WITH_LABEL(args, "rx_rate", object, GREEN, _("Receive Rate"));
+       DRAW_LINE2_WITH_LABEL(args, "rx_rate", object, COLOR_RX, _("Receive Rate"));
        PRINT_CAMM(args, "rx_rate", object, BPS, _("Bps"));
 
        // Transmit Rate
-       DRAW_LINE2_WITH_LABEL(args, "tx_rate", object, RED, _("Transmit Rate"));
+       DRAW_LINE2_WITH_LABEL(args, "tx_rate", object, COLOR_TX, _("Transmit Rate"));
        PRINT_CAMM(args, "tx_rate", object, BPS, _("Bps"));
 
        return 0;