From d620fbb88ea8767e2ea586e3ff57fd9e20ddc7ec Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Sun, 21 Jul 2024 21:46:49 -0500 Subject: Making progress --- src/screen.h | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'src/screen.h') diff --git a/src/screen.h b/src/screen.h index 7795336..a4ecf5a 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,6 +1,48 @@ #ifndef __SLOTS__SCREEN_H__184802466018249 #define __SLOTS__SCREEN_H__184802466018249 -// +#include + +#define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) + +#define RGB_MIN 0 +#define RGB_MAX 255 +#define CURSESCOLOR_MIN 0 +#define CURSESCOLOR_MAX 1000 + +enum custom_colors { + // Unspecified color + CC_UNSPEC = -1, + + /* The standard curses colors are defined here as to prevent custom colors from reusing pre-existing + // colors, in case the defaults are to be used */ + + CURSES_BLACK = COLOR_BLACK, // ncurses' default black + CURSES_RED = COLOR_RED, // ncurses' default red + CURSES_GREEN = COLOR_GREEN, // ncurses' default green + CURSES_YELLOW = COLOR_YELLOW, // ncurses' default yellow + CURSES_BLUE = COLOR_BLUE, // ncurses' default blue + CURSES_MAGENTA = COLOR_MAGENTA, // ncurses' default magenta + CURSES_CYAN = COLOR_CYAN, // ncurses' default cyan + CURSES_WHITE = COLOR_WHITE, // ncurses' default white + + CC_RED, + CC_ORANGE, + CC_YELLOW, + CC_GREEN, + CC_BLUE, + CC_PURPLE, + CC_MAGENTA, + CC_WHITE, + + // This isn't actually a color, even if you try to use it as one + CC_TOOBIG +}; + +// Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax] +static float normalize(float value, float oldmin, float oldmax, float newmin, float newmax); + +// Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range +static int init_rgb_color(int colornum, int red, int green, int blue); #endif \ No newline at end of file -- cgit v1.2.3