From 74ea6dc86646cee9915292d73d8c7afef01ef3e0 Mon Sep 17 00:00:00 2001 From: Sopár Adrián Date: Thu, 20 Jun 2024 09:28:14 +0200 Subject: First commit. This is mostly the state of the project as I left it around the end of 2019. --- src/color.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/color.c (limited to 'src/color.c') diff --git a/src/color.c b/src/color.c new file mode 100644 index 0000000..b2cc725 --- /dev/null +++ b/src/color.c @@ -0,0 +1,21 @@ +#include "color.h" +#include + +#define COLOR3_COUNT 8 + +void maze_color_init() +{ + start_color(); + short colors[COLOR3_COUNT] = {COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE}; + for (short f = 0; f < COLOR3_COUNT; f++) + for (short b = 0; b < COLOR3_COUNT; b++) + init_pair(get_color_code(f, b), f, b); +} + +short get_color_code(short foreground, short background) +{ + short code = foreground; + code |= background << 3; + code++; + return code; +} \ No newline at end of file -- cgit v1.2.3