summaryrefslogtreecommitdiff
path: root/src/ui/color.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-05 16:30:34 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-05 16:30:34 +0300
commitf38a940d722064e4b3fb2df6a6c0bcc025383ca0 (patch)
treef3df6097a60b04ff324cf9105f9cb1a4dbd825c9 /src/ui/color.h
parent2b1de0641335ab1a88aeafcc8911056f155e94c9 (diff)
Color palette theming
Diffstat (limited to 'src/ui/color.h')
-rw-r--r--src/ui/color.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/ui/color.h b/src/ui/color.h
index 11feb63e..c3cacf77 100644
--- a/src/ui/color.h
+++ b/src/ui/color.h
@@ -19,6 +19,7 @@ enum iColorId {
19 magenta_ColorId, 19 magenta_ColorId,
20 blue_ColorId, 20 blue_ColorId,
21 green_ColorId, 21 green_ColorId,
22
22 /* content theme colors */ 23 /* content theme colors */
23 tmFirst_ColorId, 24 tmFirst_ColorId,
24 tmBackground_ColorId = tmFirst_ColorId, 25 tmBackground_ColorId = tmFirst_ColorId,
@@ -29,6 +30,11 @@ enum iColorId {
29 tmHeader1_ColorId, 30 tmHeader1_ColorId,
30 tmHeader2_ColorId, 31 tmHeader2_ColorId,
31 tmHeader3_ColorId, 32 tmHeader3_ColorId,
33 tmBannerBackground_ColorId,
34 tmBannerTitle_ColorId,
35 tmBannerIcon_ColorId,
36 tmInlineContentMetadata_ColorId,
37 tmBadLink_ColorId,
32 38
33 tmLinkIcon_ColorId, 39 tmLinkIcon_ColorId,
34 tmLinkIconVisited_ColorId, 40 tmLinkIconVisited_ColorId,
@@ -51,10 +57,6 @@ enum iColorId {
51 tmGopherLinkDomain_ColorId, 57 tmGopherLinkDomain_ColorId,
52 tmGopherLinkLastVisitDate_ColorId, 58 tmGopherLinkLastVisitDate_ColorId,
53 59
54 tmInlineContentMetadata_ColorId,
55 tmBannerBackground_ColorId,
56 tmBannerTitle_ColorId,
57 tmBannerIcon_ColorId,
58 max_ColorId 60 max_ColorId
59}; 61};
60 62
@@ -87,11 +89,19 @@ struct Impl_HSLColor {
87 float hue, sat, lum, a; 89 float hue, sat, lum, a;
88}; 90};
89 91
92iHSLColor hsl_Color (iColor);
93iColor rgb_HSLColor (iHSLColor);
94
95iHSLColor setSat_HSLColor (iHSLColor, float sat);
96iHSLColor setLum_HSLColor (iHSLColor, float lum);
97iHSLColor addSatLum_HSLColor (iHSLColor, float sat, float lum);
98
90iColor get_Color (int color); 99iColor get_Color (int color);
91void set_Color (int color, iColor rgba); 100void set_Color (int color, iColor rgba);
92 101
93iHSLColor hsl_Color (iColor rgba); 102iLocalDef void setHsl_Color(int color, iHSLColor hsl) {
94iColor fromHsl_Color (iHSLColor hsl); 103 set_Color(color, rgb_HSLColor(hsl));
104}
95 105
96iColor ansi_Color (iRangecc escapeSequence, int fallback); 106iColor ansi_Color (iRangecc escapeSequence, int fallback);
97const char * escape_Color (int color); 107const char * escape_Color (int color);