add more american macros

This commit is contained in:
2025-02-12 17:58:01 +01:00
parent 3687f0076a
commit 0b8564bbaa
2 changed files with 26 additions and 3 deletions

View File

@@ -11,7 +11,6 @@ typedef union {
uint8_t r;
};
} colour32;
#define color32 colour32
#define COLOUR32_BLACK ((colour32){0x000000FF})
#define COLOUR32_RED ((colour32){0xFF0000FF})
@@ -22,3 +21,16 @@ typedef union {
#define COLOUR32_BLUE ((colour32){0x0000FFFF})
#define COLOUR32_MAGENTA ((colour32){0xFF00FFFF})
#define COLOUR32_WHITE ((colour32){0xFFFFFFFF})
// american macros:
#define color32 colour32
#define COLOR32_BLACK COLOUR32_BLACK
#define COLOR32_RED COLOUR32_RED
#define COLOR32_YELLOW COLOUR32_YELLOW
#define COLOR32_ORANGE COLOUR32_ORANGE
#define COLOR32_GREEN COLOUR32_GREEN
#define COLOR32_CYAN COLOUR32_CYAN
#define COLOR32_BLUE COLOUR32_BLUE
#define COLOR32_MAGENTA COLOUR32_MAGENTA
#define COLOR32_WHITE COLOUR32_WHITE

View File

@@ -10,9 +10,8 @@ typedef union {
uint8_t r : 3;
};
} colour8;
#define color8 colour8
/* rrrg ggbb */
/* rrrg ggbb */
#define COLOUR8_BLACK ((colour8){0x00}) // 0000 0000
#define COLOUR8_RED ((colour8){0xE0}) // 1110 0000
#define COLOUR8_YELLOW ((colour8){0xFC}) // 1111 1100
@@ -37,3 +36,15 @@ static inline uint8_t colour8_green32(colour8 const colour) {
static inline uint8_t colour8_blue32(colour8 const colour) {
return colour.b * (255 / 3);
}
// american macros:
#define color8 colour8
#define COLOR8_BLACK COLOUR8_BLACK
#define COLOR8_RED COLOUR8_RED
#define COLOR8_YELLOW COLOUR8_YELLOW
#define COLOR8_ORANGE COLOUR8_ORANGE
#define COLOR8_GREEN COLOUR8_GREEN
#define COLOR8_CYAN COLOUR8_CYAN
#define COLOR8_BLUE COLOUR8_BLUE
#define COLOR8_MAGENTA COLOUR8_MAGENTA
#define COLOR8_WHITE COLOUR8_WHITE