summaryrefslogtreecommitdiff
path: root/src/ui/color.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-21 22:17:37 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-21 22:17:37 +0300
commit2bf206181e8e3ce6d1b7e899de7c4cc04778a087 (patch)
tree7ab6f85581003b767fe2c94b0fc20902903aceb5 /src/ui/color.c
parentdac7819e5de1e531a86145257243fde88f924a4e (diff)
LabelWidget: Tuned state colors
Diffstat (limited to 'src/ui/color.c')
-rw-r--r--src/ui/color.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui/color.c b/src/ui/color.c
index 4ecdcf76..072c4b3f 100644
--- a/src/ui/color.c
+++ b/src/ui/color.c
@@ -482,6 +482,24 @@ const char *escape_Color(int color) {
482 return format_CStr("\v%c", color + asciiBase_ColorEscape); 482 return format_CStr("\v%c", color + asciiBase_ColorEscape);
483} 483}
484 484
485enum iColorId parseEscape_Color(const char *cstr, const char **endp) {
486 enum iColorId color = none_ColorId;
487 if (*cstr == '\v') {
488 cstr++;
489 color = 0;
490 if (*cstr == '\v') {
491 color += asciiExtended_ColorEscape;
492 cstr++;
493 }
494 color += *cstr - asciiBase_ColorEscape;
495 cstr++;
496 }
497 if (endp) {
498 *endp = cstr;
499 }
500 return color;
501}
502
485iHSLColor setSat_HSLColor(iHSLColor d, float sat) { 503iHSLColor setSat_HSLColor(iHSLColor d, float sat) {
486 d.sat = iClamp(sat, 0, 1); 504 d.sat = iClamp(sat, 0, 1);
487 return d; 505 return d;