mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-28 05:26:18 +08:00
#include and use LV_MATH_ABS
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_color.h"
|
||||
#include "lv_math.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -126,7 +127,7 @@ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8)
|
||||
hsv.v = (100 * rgbMax) >> 10;
|
||||
|
||||
int32_t delta = rgbMax - rgbMin;
|
||||
if (abs(delta) < 3) {
|
||||
if (LV_MATH_ABS(delta) < 3) {
|
||||
hsv.h = 0;
|
||||
hsv.s = 0;
|
||||
return hsv;
|
||||
|
||||
Reference in New Issue
Block a user