diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/color.c | 4 | ||||
-rw-r--r-- | src/ui/color.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ui/color.c b/src/ui/color.c index 1df890e2..cd22ac95 100644 --- a/src/ui/color.c +++ b/src/ui/color.c | |||
@@ -273,6 +273,10 @@ iColor mix_Color(iColor c1, iColor c2, float t) { | |||
273 | c1.a * (1 - t) + c2.a * t }; | 273 | c1.a * (1 - t) + c2.a * t }; |
274 | } | 274 | } |
275 | 275 | ||
276 | int delta_Color(iColor c1, iColor c2) { | ||
277 | return iAbs(c1.r - c2.r) + iAbs(c1.g - c2.g) + iAbs(c1.b - c2.b); | ||
278 | } | ||
279 | |||
276 | iLocalDef iBool equal_Color_(const iColor *x, const iColor *y) { | 280 | iLocalDef iBool equal_Color_(const iColor *x, const iColor *y) { |
277 | return memcmp(x, y, sizeof(iColor)) == 0; | 281 | return memcmp(x, y, sizeof(iColor)) == 0; |
278 | } | 282 | } |
diff --git a/src/ui/color.h b/src/ui/color.h index 0f534272..d1c52685 100644 --- a/src/ui/color.h +++ b/src/ui/color.h | |||
@@ -214,7 +214,11 @@ int darker_Color (int color); | |||
214 | int lighter_Color (int color); | 214 | int lighter_Color (int color); |
215 | void set_Color (int color, iColor rgba); | 215 | void set_Color (int color, iColor rgba); |
216 | iColor mix_Color (iColor c1, iColor c2, float t); | 216 | iColor mix_Color (iColor c1, iColor c2, float t); |
217 | int delta_Color (iColor c1, iColor c2); | ||
217 | 218 | ||
219 | iLocalDef iHSLColor get_HSLColor(int color) { | ||
220 | return hsl_Color(get_Color(color)); | ||
221 | } | ||
218 | iLocalDef void setHsl_Color(int color, iHSLColor hsl) { | 222 | iLocalDef void setHsl_Color(int color, iHSLColor hsl) { |
219 | set_Color(color, rgb_HSLColor(hsl)); | 223 | set_Color(color, rgb_HSLColor(hsl)); |
220 | } | 224 | } |