diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 53538c3d..9b7bd630 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -568,6 +568,36 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
568 | /* Default colors. */ { | 568 | /* Default colors. */ { |
569 | const iHSLColor base = { 0, 0, 0.15f, 1.0f }; | 569 | const iHSLColor base = { 0, 0, 0.15f, 1.0f }; |
570 | setHsl_Color(tmBackground_ColorId, base); | 570 | setHsl_Color(tmBackground_ColorId, base); |
571 | set_Color(tmParagraph_ColorId, get_Color(gray75_ColorId)); | ||
572 | setHsl_Color(tmFirstParagraph_ColorId, addSatLum_HSLColor(base, 0, 0.75f)); | ||
573 | set_Color(tmQuote_ColorId, get_Color(cyan_ColorId)); | ||
574 | set_Color(tmPreformatted_ColorId, get_Color(cyan_ColorId)); | ||
575 | set_Color(tmHeader1_ColorId, get_Color(white_ColorId)); | ||
576 | setHsl_Color(tmHeader2_ColorId, addSatLum_HSLColor(base, 0, 0.7f)); | ||
577 | setHsl_Color(tmHeader3_ColorId, addSatLum_HSLColor(base, 0, 0.6f)); | ||
578 | set_Color(tmBannerBackground_ColorId, get_Color(black_ColorId)); | ||
579 | set_Color(tmBannerTitle_ColorId, get_Color(white_ColorId)); | ||
580 | set_Color(tmBannerIcon_ColorId, get_Color(orange_ColorId)); | ||
581 | set_Color(tmInlineContentMetadata_ColorId, get_Color(cyan_ColorId)); | ||
582 | set_Color(tmBadLink_ColorId, get_Color(red_ColorId)); | ||
583 | set_Color(tmLinkText_ColorId, get_Color(white_ColorId)); | ||
584 | set_Color(tmLinkIcon_ColorId, get_Color(cyan_ColorId)); | ||
585 | set_Color(tmLinkTextHover_ColorId, get_Color(cyan_ColorId)); | ||
586 | set_Color(tmLinkIconVisited_ColorId, get_Color(teal_ColorId)); | ||
587 | set_Color(tmLinkDomain_ColorId, get_Color(teal_ColorId)); | ||
588 | set_Color(tmLinkLastVisitDate_ColorId, get_Color(cyan_ColorId)); | ||
589 | set_Color(tmHypertextLinkText_ColorId, get_Color(white_ColorId)); | ||
590 | set_Color(tmHypertextLinkIcon_ColorId, get_Color(orange_ColorId)); | ||
591 | set_Color(tmHypertextLinkTextHover_ColorId, get_Color(orange_ColorId)); | ||
592 | set_Color(tmHypertextLinkIconVisited_ColorId, get_Color(brown_ColorId)); | ||
593 | set_Color(tmHypertextLinkDomain_ColorId, get_Color(brown_ColorId)); | ||
594 | set_Color(tmHypertextLinkLastVisitDate_ColorId, get_Color(orange_ColorId)); | ||
595 | set_Color(tmGopherLinkText_ColorId, get_Color(white_ColorId)); | ||
596 | set_Color(tmGopherLinkIcon_ColorId, get_Color(blue_ColorId)); | ||
597 | set_Color(tmGopherLinkTextHover_ColorId, get_Color(blue_ColorId)); | ||
598 | set_Color(tmGopherLinkIconVisited_ColorId, get_Color(magenta_ColorId)); | ||
599 | set_Color(tmGopherLinkDomain_ColorId, get_Color(magenta_ColorId)); | ||
600 | set_Color(tmGopherLinkLastVisitDate_ColorId, get_Color(blue_ColorId)); | ||
571 | } | 601 | } |
572 | if (seed && !isEmpty_Block(seed)) { | 602 | if (seed && !isEmpty_Block(seed)) { |
573 | d->themeSeed = crc32_Block(seed); | 603 | d->themeSeed = crc32_Block(seed); |
@@ -577,7 +607,7 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
577 | 0, 60, 90, 100, 180, 210, 230, 260, 330 | 607 | 0, 60, 90, 100, 180, 210, 230, 260, 330 |
578 | }; | 608 | }; |
579 | const float saturationLevel = 1.0f; /* TODO: user setting */ | 609 | const float saturationLevel = 1.0f; /* TODO: user setting */ |
580 | const iBool isLightMode = !iFalse; /* TODO: user setting */ | 610 | const iBool isLightMode = iFalse; /* TODO: user setting */ |
581 | const iBool isBannerLighter = (d->themeSeed & 0x4000) != 0; | 611 | const iBool isBannerLighter = (d->themeSeed & 0x4000) != 0; |
582 | const iBool isDarkBgSat = (d->themeSeed & 0x200000) != 0; | 612 | const iBool isDarkBgSat = (d->themeSeed & 0x200000) != 0; |
583 | iHSLColor base = { hues[(d->themeSeed & 0xff) % iElemCount(hues)], | 613 | iHSLColor base = { hues[(d->themeSeed & 0xff) % iElemCount(hues)], |
@@ -608,28 +638,6 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
608 | setHsl_Color(tmPreformatted_ColorId, (iHSLColor){ altHue2, 1.0f, 0.75f, 1.0f }); | 638 | setHsl_Color(tmPreformatted_ColorId, (iHSLColor){ altHue2, 1.0f, 0.75f, 1.0f }); |
609 | set_Color(tmQuote_ColorId, get_Color(tmPreformatted_ColorId)); | 639 | set_Color(tmQuote_ColorId, get_Color(tmPreformatted_ColorId)); |
610 | set_Color(tmInlineContentMetadata_ColorId, get_Color(tmHeader3_ColorId)); | 640 | set_Color(tmInlineContentMetadata_ColorId, get_Color(tmHeader3_ColorId)); |
611 | set_Color(tmBadLink_ColorId, get_Color(red_ColorId)); | ||
612 | |||
613 | set_Color(tmLinkText_ColorId, get_Color(white_ColorId)); | ||
614 | set_Color(tmLinkIcon_ColorId, get_Color(cyan_ColorId)); | ||
615 | set_Color(tmLinkTextHover_ColorId, get_Color(cyan_ColorId)); | ||
616 | set_Color(tmLinkIconVisited_ColorId, get_Color(teal_ColorId)); | ||
617 | set_Color(tmLinkDomain_ColorId, get_Color(teal_ColorId)); | ||
618 | set_Color(tmLinkLastVisitDate_ColorId, get_Color(cyan_ColorId)); | ||
619 | |||
620 | set_Color(tmHypertextLinkText_ColorId, get_Color(white_ColorId)); | ||
621 | set_Color(tmHypertextLinkIcon_ColorId, get_Color(orange_ColorId)); | ||
622 | set_Color(tmHypertextLinkTextHover_ColorId, get_Color(orange_ColorId)); | ||
623 | set_Color(tmHypertextLinkIconVisited_ColorId, get_Color(brown_ColorId)); | ||
624 | set_Color(tmHypertextLinkDomain_ColorId, get_Color(brown_ColorId)); | ||
625 | set_Color(tmHypertextLinkLastVisitDate_ColorId, get_Color(orange_ColorId)); | ||
626 | |||
627 | set_Color(tmGopherLinkText_ColorId, get_Color(white_ColorId)); | ||
628 | set_Color(tmGopherLinkIcon_ColorId, get_Color(blue_ColorId)); | ||
629 | set_Color(tmGopherLinkTextHover_ColorId, get_Color(blue_ColorId)); | ||
630 | set_Color(tmGopherLinkIconVisited_ColorId, get_Color(magenta_ColorId)); | ||
631 | set_Color(tmGopherLinkDomain_ColorId, get_Color(magenta_ColorId)); | ||
632 | set_Color(tmGopherLinkLastVisitDate_ColorId, get_Color(blue_ColorId)); | ||
633 | 641 | ||
634 | /* Adjust colors based on light/dark mode. */ | 642 | /* Adjust colors based on light/dark mode. */ |
635 | for (int i = tmFirst_ColorId; i < max_ColorId; i++) { | 643 | for (int i = tmFirst_ColorId; i < max_ColorId; i++) { |
@@ -666,7 +674,7 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
666 | color.lum = (color.lum + 2) / 3; | 674 | color.lum = (color.lum + 2) / 3; |
667 | } | 675 | } |
668 | else { | 676 | else { |
669 | color.sat = 0.8f; | 677 | color.sat *= 0.8f; |
670 | color.lum = 0.4f; | 678 | color.lum = 0.4f; |
671 | } | 679 | } |
672 | } | 680 | } |