diff options
Diffstat (limited to 'src/screen.h')
| -rw-r--r-- | src/screen.h | 44 |
1 files changed, 43 insertions, 1 deletions
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 @@ | |||
| 1 | #ifndef __SLOTS__SCREEN_H__184802466018249 | 1 | #ifndef __SLOTS__SCREEN_H__184802466018249 |
| 2 | #define __SLOTS__SCREEN_H__184802466018249 | 2 | #define __SLOTS__SCREEN_H__184802466018249 |
| 3 | 3 | ||
| 4 | // | 4 | #include <curses.h> |
| 5 | |||
| 6 | #define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) | ||
| 7 | |||
| 8 | #define RGB_MIN 0 | ||
| 9 | #define RGB_MAX 255 | ||
| 10 | #define CURSESCOLOR_MIN 0 | ||
| 11 | #define CURSESCOLOR_MAX 1000 | ||
| 12 | |||
| 13 | enum custom_colors { | ||
| 14 | // Unspecified color | ||
| 15 | CC_UNSPEC = -1, | ||
| 16 | |||
| 17 | /* The standard curses colors are defined here as to prevent custom colors from reusing pre-existing | ||
| 18 | // colors, in case the defaults are to be used */ | ||
| 19 | |||
| 20 | CURSES_BLACK = COLOR_BLACK, // ncurses' default black | ||
| 21 | CURSES_RED = COLOR_RED, // ncurses' default red | ||
| 22 | CURSES_GREEN = COLOR_GREEN, // ncurses' default green | ||
| 23 | CURSES_YELLOW = COLOR_YELLOW, // ncurses' default yellow | ||
| 24 | CURSES_BLUE = COLOR_BLUE, // ncurses' default blue | ||
| 25 | CURSES_MAGENTA = COLOR_MAGENTA, // ncurses' default magenta | ||
| 26 | CURSES_CYAN = COLOR_CYAN, // ncurses' default cyan | ||
| 27 | CURSES_WHITE = COLOR_WHITE, // ncurses' default white | ||
| 28 | |||
| 29 | CC_RED, | ||
| 30 | CC_ORANGE, | ||
| 31 | CC_YELLOW, | ||
| 32 | CC_GREEN, | ||
| 33 | CC_BLUE, | ||
| 34 | CC_PURPLE, | ||
| 35 | CC_MAGENTA, | ||
| 36 | CC_WHITE, | ||
| 37 | |||
| 38 | // This isn't actually a color, even if you try to use it as one | ||
| 39 | CC_TOOBIG | ||
| 40 | }; | ||
| 41 | |||
| 42 | // Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax] | ||
| 43 | static float normalize(float value, float oldmin, float oldmax, float newmin, float newmax); | ||
| 44 | |||
| 45 | // Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range | ||
| 46 | static int init_rgb_color(int colornum, int red, int green, int blue); | ||
| 5 | 47 | ||
| 6 | #endif \ No newline at end of file | 48 | #endif \ No newline at end of file |
