Add rgb565cmp() color helper

This commit is contained in:
Willy-JL
2024-03-08 00:28:34 +00:00
parent d09a8f2517
commit 5a61ee4944
3 changed files with 7 additions and 0 deletions

View File

@@ -86,3 +86,7 @@ void rgb2hsv(const RgbColor* rgb, HsvColor* hsv) {
hsv->h = 171 + 43 * (rgb->r - rgb->g) / (rgbMax - rgbMin);
}
}
inline int rgb565cmp(const Rgb565Color* a, const Rgb565Color* b) {
return memcmp(a, b, sizeof(Rgb565Color));
}

View File

@@ -34,6 +34,8 @@ typedef union {
};
} Rgb565Color;
int rgb565cmp(const Rgb565Color* a, const Rgb565Color* b);
#ifdef __cplusplus
}
#endif

View File

@@ -2958,6 +2958,7 @@ Function,-,rename,int,"const char*, const char*"
Function,-,renameat,int,"int, const char*, int, const char*"
Function,-,rewind,void,FILE*
Function,+,rgb2hsv,void,"const RgbColor*, HsvColor*"
Function,+,rgb565cmp,int,"const Rgb565Color*, const Rgb565Color*"
Function,+,rgb_backlight_get_color,void,"uint8_t, RgbColor*"
Function,+,rgb_backlight_get_rainbow_interval,uint32_t,
Function,+,rgb_backlight_get_rainbow_mode,RGBBacklightRainbowMode,
1 entry status name type params
2958 Function - renameat int int, const char*, int, const char*
2959 Function - rewind void FILE*
2960 Function + rgb2hsv void const RgbColor*, HsvColor*
2961 Function + rgb565cmp int const Rgb565Color*, const Rgb565Color*
2962 Function + rgb_backlight_get_color void uint8_t, RgbColor*
2963 Function + rgb_backlight_get_rainbow_interval uint32_t
2964 Function + rgb_backlight_get_rainbow_mode RGBBacklightRainbowMode