diff --git a/headers/os/interface/GraphicsDefs.h b/headers/os/interface/GraphicsDefs.h index a09db9171b..30d1fc619d 100644 --- a/headers/os/interface/GraphicsDefs.h +++ b/headers/os/interface/GraphicsDefs.h @@ -60,6 +60,22 @@ typedef struct rgb_color { uint8 green; uint8 blue; uint8 alpha; + +#if defined(__cplusplus) + // some convenient additions + + inline bool + operator==(const rgb_color& other) const + { + return *(const uint32 *)this == *(const uint32 *)&other; + } + + inline bool + operator!=(const rgb_color& other) const + { + return *(const uint32 *)this != *(const uint32 *)&other; + } +#endif } rgb_color; //------------------------------------------------------------------------------