diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-18 21:40:08 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-18 21:40:08 +0300 |
commit | 69b71ecd9760a02dd243d51580348d3ed698d0f7 (patch) | |
tree | cf9f5b5529da7cbbf06d4e206efb0f1ede6c20d8 /src/gmdocument.c | |
parent | cb708fcad4083fea37d52562b0dddbdd85eba42e (diff) |
Added the "Colorful Light" document theme
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 389cbfb2..c04017e5 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -713,6 +713,20 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
713 | set_Color(tmBannerTitle_ColorId, get_Color(white_ColorId)); | 713 | set_Color(tmBannerTitle_ColorId, get_Color(white_ColorId)); |
714 | set_Color(tmBannerIcon_ColorId, get_Color(orange_ColorId)); | 714 | set_Color(tmBannerIcon_ColorId, get_Color(orange_ColorId)); |
715 | } | 715 | } |
716 | else if (theme == colorfulLight_GmDocumentTheme) { | ||
717 | const iHSLColor base = { 190, 1.0f, 0.35f, 1.0f }; | ||
718 | setHsl_Color(tmBackground_ColorId, base); | ||
719 | set_Color(tmParagraph_ColorId, get_Color(black_ColorId)); | ||
720 | set_Color(tmFirstParagraph_ColorId, get_Color(black_ColorId)); | ||
721 | setHsl_Color(tmQuote_ColorId, addSatLum_HSLColor(base, 0, -0.2f)); | ||
722 | setHsl_Color(tmPreformatted_ColorId, addSatLum_HSLColor(base, 0, -0.3f)); | ||
723 | set_Color(tmHeading1_ColorId, get_Color(white_ColorId)); | ||
724 | set_Color(tmHeading2_ColorId, mix_Color(get_Color(tmBackground_ColorId), get_Color(white_ColorId), 0.85f)); | ||
725 | set_Color(tmHeading3_ColorId, mix_Color(get_Color(tmBackground_ColorId), get_Color(white_ColorId), 0.75f)); | ||
726 | setHsl_Color(tmBannerBackground_ColorId, base); | ||
727 | setHsl_Color(tmBannerIcon_ColorId, addSatLum_HSLColor(base, 0, -0.2f)); | ||
728 | setHsl_Color(tmBannerTitle_ColorId, addSatLum_HSLColor(base, 0, -0.2f)); | ||
729 | } | ||
716 | else if (theme == black_GmDocumentTheme) { | 730 | else if (theme == black_GmDocumentTheme) { |
717 | set_Color(tmBackground_ColorId, get_Color(black_ColorId)); | 731 | set_Color(tmBackground_ColorId, get_Color(black_ColorId)); |
718 | set_Color(tmParagraph_ColorId, get_Color(gray75_ColorId)); | 732 | set_Color(tmParagraph_ColorId, get_Color(gray75_ColorId)); |
@@ -813,7 +827,9 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
813 | violet_Hue, | 827 | violet_Hue, |
814 | pink_Hue | 828 | pink_Hue |
815 | }; | 829 | }; |
816 | static const float hues[] = { 5, 25, 40, 56, 80, 120, 160, 180, 208, 231, 270, 324 }; | 830 | static const float hues[] = { 5, 25, 40, 56, 80, 120, 160, 180, 208, 231, 270, 324 }; |
831 | static const float normLum[] = { 0.65f, 0.5f, 0.4f, 0.45f, 0.3f, 0.4f, | ||
832 | 0.35f, 0.35f, 0.55f, 0.7f, 0.7f, 0.65f }; | ||
817 | static const struct { | 833 | static const struct { |
818 | int index[2]; | 834 | int index[2]; |
819 | } altHues[iElemCount(hues)] = { | 835 | } altHues[iElemCount(hues)] = { |
@@ -886,6 +902,30 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
886 | set_Color(tmQuote_ColorId, get_Color(tmPreformatted_ColorId)); | 902 | set_Color(tmQuote_ColorId, get_Color(tmPreformatted_ColorId)); |
887 | set_Color(tmInlineContentMetadata_ColorId, get_Color(tmHeading3_ColorId)); | 903 | set_Color(tmInlineContentMetadata_ColorId, get_Color(tmHeading3_ColorId)); |
888 | } | 904 | } |
905 | else if (theme == colorfulLight_GmDocumentTheme) { | ||
906 | iHSLColor base = { hues[primIndex], 1.0f, normLum[primIndex], 1.0f }; | ||
907 | printf("prim:%d norm:%f\n", primIndex, normLum[primIndex]); fflush(stdout); | ||
908 | if (primIndex == 1) { | ||
909 | base.sat -= 0.1f; | ||
910 | } | ||
911 | if (primIndex == 0 || primIndex == 3 || primIndex == 5 || primIndex == 11) { | ||
912 | base.sat -= 0.25f; | ||
913 | } | ||
914 | if (primIndex == 3) { | ||
915 | base.sat -= 0.4f; | ||
916 | } | ||
917 | setHsl_Color(tmBackground_ColorId, base); | ||
918 | set_Color(tmParagraph_ColorId, get_Color(black_ColorId)); | ||
919 | set_Color(tmFirstParagraph_ColorId, get_Color(black_ColorId)); | ||
920 | setHsl_Color(tmQuote_ColorId, addSatLum_HSLColor(base, 0, -base.lum * 0.5f)); | ||
921 | setHsl_Color(tmPreformatted_ColorId, addSatLum_HSLColor(base, 0, -base.lum * 0.67f)); | ||
922 | set_Color(tmHeading1_ColorId, get_Color(white_ColorId)); | ||
923 | set_Color(tmHeading2_ColorId, mix_Color(get_Color(tmBackground_ColorId), get_Color(white_ColorId), 0.85f)); | ||
924 | set_Color(tmHeading3_ColorId, mix_Color(get_Color(tmBackground_ColorId), get_Color(white_ColorId), 0.75f)); | ||
925 | setHsl_Color(tmBannerBackground_ColorId, addSatLum_HSLColor(base, 0, -0.04f)); | ||
926 | setHsl_Color(tmBannerIcon_ColorId, addSatLum_HSLColor(base, 0, -0.3f)); | ||
927 | setHsl_Color(tmBannerTitle_ColorId, addSatLum_HSLColor(base, 0, -0.25f)); | ||
928 | } | ||
889 | else if (theme == white_GmDocumentTheme) { | 929 | else if (theme == white_GmDocumentTheme) { |
890 | iHSLColor base = { hues[primIndex], 1.0f, 0.3f, 1.0f }; | 930 | iHSLColor base = { hues[primIndex], 1.0f, 0.3f, 1.0f }; |
891 | iHSLColor altBase = { altHue, base.sat, base.lum - 0.1f, 1 }; | 931 | iHSLColor altBase = { altHue, base.sat, base.lum - 0.1f, 1 }; |
@@ -895,7 +935,7 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
895 | setHsl_Color(tmBannerTitle_ColorId, addSatLum_HSLColor(base, -0.6f, 0.25f)); | 935 | setHsl_Color(tmBannerTitle_ColorId, addSatLum_HSLColor(base, -0.6f, 0.25f)); |
896 | setHsl_Color(tmBannerIcon_ColorId, addSatLum_HSLColor(base, 0, 0)); | 936 | setHsl_Color(tmBannerIcon_ColorId, addSatLum_HSLColor(base, 0, 0)); |
897 | 937 | ||
898 | setHsl_Color(tmHeading1_ColorId, base); //addSatLum_HSLColor(base, -0.5f, 0.125f)); | 938 | setHsl_Color(tmHeading1_ColorId, base); |
899 | set_Color(tmHeading2_ColorId, mix_Color(rgb_HSLColor(base), rgb_HSLColor(altBase), 0.5f)); | 939 | set_Color(tmHeading2_ColorId, mix_Color(rgb_HSLColor(base), rgb_HSLColor(altBase), 0.5f)); |
900 | setHsl_Color(tmHeading3_ColorId, altBase); | 940 | setHsl_Color(tmHeading3_ColorId, altBase); |
901 | 941 | ||