diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-21 15:27:49 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-21 15:27:49 +0300 |
commit | 6b7dd0e0d450309790deeaf765706d30168a26a6 (patch) | |
tree | 6d37a588617bbddeed590a853b0b34ce23dfe0e4 /src/gmdocument.c | |
parent | b7028a750875c67c35902fcf814c69239959d1ab (diff) |
Added theme colors for the hover outline
Still need to choose them based on the current theme.
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 8390aab6..02ca2bba 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -644,6 +644,16 @@ static float dimLightness_(float hue, float baseOffset) { | |||
644 | return baseOffset + extra; | 644 | return baseOffset + extra; |
645 | } | 645 | } |
646 | 646 | ||
647 | static void setDerivedThemeColors_(enum iGmDocumentTheme theme) { | ||
648 | set_Color(tmQuoteIcon_ColorId, | ||
649 | mix_Color(get_Color(tmQuote_ColorId), get_Color(tmBackground_ColorId), 0.55f)); | ||
650 | set_Color(tmBannerSideTitle_ColorId, | ||
651 | mix_Color(get_Color(tmBannerTitle_ColorId), get_Color(tmBackground_ColorId), | ||
652 | theme == colorfulDark_GmDocumentTheme ? 0.55f : 0)); | ||
653 | set_Color(tmOutlineHeadingAbove_ColorId, get_Color(white_ColorId)); | ||
654 | set_Color(tmOutlineHeadingBelow_ColorId, get_Color(black_ColorId)); | ||
655 | } | ||
656 | |||
647 | void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | 657 | void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { |
648 | const iPrefs * prefs = prefs_App(); | 658 | const iPrefs * prefs = prefs_App(); |
649 | enum iGmDocumentTheme theme = | 659 | enum iGmDocumentTheme theme = |
@@ -701,7 +711,8 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
701 | set_Color(tmGopherLinkDomain_ColorId, get_Color(magenta_ColorId)); | 711 | set_Color(tmGopherLinkDomain_ColorId, get_Color(magenta_ColorId)); |
702 | set_Color(tmGopherLinkLastVisitDate_ColorId, get_Color(blue_ColorId)); | 712 | set_Color(tmGopherLinkLastVisitDate_ColorId, get_Color(blue_ColorId)); |
703 | } | 713 | } |
704 | /* Set the non-link default colors. */ | 714 | /* Set the non-link default colors. Note that some/most of these are overwritten later |
715 | if a theme seed if available. */ | ||
705 | if (theme == colorfulDark_GmDocumentTheme) { | 716 | if (theme == colorfulDark_GmDocumentTheme) { |
706 | const iHSLColor base = { 200, 0, 0.15f, 1.0f }; | 717 | const iHSLColor base = { 200, 0, 0.15f, 1.0f }; |
707 | setHsl_Color(tmBackground_ColorId, base); | 718 | setHsl_Color(tmBackground_ColorId, base); |
@@ -729,7 +740,7 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
729 | setHsl_Color(tmBannerBackground_ColorId, addSatLum_HSLColor(base, 0, -0.1f)); | 740 | setHsl_Color(tmBannerBackground_ColorId, addSatLum_HSLColor(base, 0, -0.1f)); |
730 | setHsl_Color(tmBannerIcon_ColorId, addSatLum_HSLColor(base, 0, -0.2f)); | 741 | setHsl_Color(tmBannerIcon_ColorId, addSatLum_HSLColor(base, 0, -0.2f)); |
731 | setHsl_Color(tmBannerTitle_ColorId, addSatLum_HSLColor(base, 0, -0.2f)); | 742 | setHsl_Color(tmBannerTitle_ColorId, addSatLum_HSLColor(base, 0, -0.2f)); |
732 | setHsl_Color(tmLinkIcon_ColorId, addSatLum_HSLColor(get_HSLColor(teal_ColorId), 0, 0.15f)); | 743 | setHsl_Color(tmLinkIcon_ColorId, addSatLum_HSLColor(get_HSLColor(teal_ColorId), 0, 0)); |
733 | set_Color(tmLinkIconVisited_ColorId, mix_Color(get_Color(tmBackground_ColorId), get_Color(teal_ColorId), 0.35f)); | 744 | set_Color(tmLinkIconVisited_ColorId, mix_Color(get_Color(tmBackground_ColorId), get_Color(teal_ColorId), 0.35f)); |
734 | set_Color(tmLinkDomain_ColorId, get_Color(teal_ColorId)); | 745 | set_Color(tmLinkDomain_ColorId, get_Color(teal_ColorId)); |
735 | setHsl_Color(tmHypertextLinkIcon_ColorId, get_HSLColor(white_ColorId)); | 746 | setHsl_Color(tmHypertextLinkIcon_ColorId, get_HSLColor(white_ColorId)); |
@@ -1009,11 +1020,7 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
1009 | } | 1020 | } |
1010 | } | 1021 | } |
1011 | /* Derived colors. */ | 1022 | /* Derived colors. */ |
1012 | set_Color(tmQuoteIcon_ColorId, | 1023 | setDerivedThemeColors_(theme); |
1013 | mix_Color(get_Color(tmQuote_ColorId), get_Color(tmBackground_ColorId), 0.55f)); | ||
1014 | set_Color(tmBannerSideTitle_ColorId, | ||
1015 | mix_Color(get_Color(tmBannerTitle_ColorId), get_Color(tmBackground_ColorId), | ||
1016 | theme == colorfulDark_GmDocumentTheme ? 0.55f : 0)); | ||
1017 | /* Special exceptions. */ | 1024 | /* Special exceptions. */ |
1018 | if (seed) { | 1025 | if (seed) { |
1019 | if (equal_CStr(cstr_Block(seed), "gemini.circumlunar.space")) { | 1026 | if (equal_CStr(cstr_Block(seed), "gemini.circumlunar.space")) { |