diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-05 16:30:34 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-05 16:30:34 +0300 |
commit | f38a940d722064e4b3fb2df6a6c0bcc025383ca0 (patch) | |
tree | f3df6097a60b04ff324cf9105f9cb1a4dbd825c9 /src/ui/color.h | |
parent | 2b1de0641335ab1a88aeafcc8911056f155e94c9 (diff) |
Color palette theming
Diffstat (limited to 'src/ui/color.h')
-rw-r--r-- | src/ui/color.h | 22 |
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 | ||
92 | iHSLColor hsl_Color (iColor); | ||
93 | iColor rgb_HSLColor (iHSLColor); | ||
94 | |||
95 | iHSLColor setSat_HSLColor (iHSLColor, float sat); | ||
96 | iHSLColor setLum_HSLColor (iHSLColor, float lum); | ||
97 | iHSLColor addSatLum_HSLColor (iHSLColor, float sat, float lum); | ||
98 | |||
90 | iColor get_Color (int color); | 99 | iColor get_Color (int color); |
91 | void set_Color (int color, iColor rgba); | 100 | void set_Color (int color, iColor rgba); |
92 | 101 | ||
93 | iHSLColor hsl_Color (iColor rgba); | 102 | iLocalDef void setHsl_Color(int color, iHSLColor hsl) { |
94 | iColor fromHsl_Color (iHSLColor hsl); | 103 | set_Color(color, rgb_HSLColor(hsl)); |
104 | } | ||
95 | 105 | ||
96 | iColor ansi_Color (iRangecc escapeSequence, int fallback); | 106 | iColor ansi_Color (iRangecc escapeSequence, int fallback); |
97 | const char * escape_Color (int color); | 107 | const char * escape_Color (int color); |