summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/color.c4
-rw-r--r--src/ui/color.h4
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
276int 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
276iLocalDef iBool equal_Color_(const iColor *x, const iColor *y) { 280iLocalDef 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);
214int lighter_Color (int color); 214int lighter_Color (int color);
215void set_Color (int color, iColor rgba); 215void set_Color (int color, iColor rgba);
216iColor mix_Color (iColor c1, iColor c2, float t); 216iColor mix_Color (iColor c1, iColor c2, float t);
217int delta_Color (iColor c1, iColor c2);
217 218
219iLocalDef iHSLColor get_HSLColor(int color) {
220 return hsl_Color(get_Color(color));
221}
218iLocalDef void setHsl_Color(int color, iHSLColor hsl) { 222iLocalDef void setHsl_Color(int color, iHSLColor hsl) {
219 set_Color(color, rgb_HSLColor(hsl)); 223 set_Color(color, rgb_HSLColor(hsl));
220} 224}