diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-07-12 17:00:40 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-07-12 17:00:40 -0400 |
commit | 20ddd44176b15e778ed11b43030419a55fa04542 (patch) | |
tree | 39c01050678c944acd7ab27ce0323c3f8ebd7a5f /include/constants | |
parent | 6f7f507c504736f4b70278bc293dd8a79b2f85e3 (diff) |
Remove braces around one-line expressions; add constants/rgb.h
Diffstat (limited to 'include/constants')
-rw-r--r-- | include/constants/rgb.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/constants/rgb.h b/include/constants/rgb.h new file mode 100644 index 000000000..136b74d5e --- /dev/null +++ b/include/constants/rgb.h @@ -0,0 +1,13 @@ +#ifndef POKERUBY_CONSTANTS_RGB_H +#define POKERUBY_CONSTANTS_RGB_H + +#define GET_R(color) ((color) & 0x1F) +#define GET_G(color) (((color) >> 5) & 0x1F) +#define GET_B(color) (((color) >> 10) & 0x1F) + +#define RGB_ALPHA (1 << 15) +#define IS_ALPHA(color) ((color) & RGB_ALPHA) + +#define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) + +#endif // POKERUBY_CONSTANTS_RGB_H |