summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 4d0df29..faaecb6 100644
--- a/src/common.h
+++ b/src/common.h
@@ -36,8 +36,14 @@ struct xyz {
#define COLOR_GREEN 0x00FF00
#define COLOR_BLUE 0x0000FF
#define COLOR_LIGHTWHITE 0xF5F5F5
+
#define color(col) (((col)>>16) & 0xFF), (((col)>>8) & 0xFF), ((col) & 0xFF)
+#define scale_color(col, z) \
+ (((((col >> 16) & 0xFF) - clamp(z, 0, 255)) << 16) | \
+ ((((col >> 8) & 0xFF) - clamp(z, 0, 255)) << 8) | \
+ ((col & 0xFF) - clamp(z, 0, 255)))
+
// macro wrapper for the sdl logging system
#include <SDL2/SDL.h>
#define LOG_APPLICATION SDL_LOG_CATEGORY_APPLICATION