Revert to using a readable foreground for the org-habit faces

This relies on our own functions, which should be available even if
the theme is loaded via the early-init.el.

Thanks to Jacod "Jake" Gordon for reminding me to fix this and for
testing my prototype. It was done in issue 197:
<https://github.com/protesilaos/modus-themes/issues/197>.
This commit is contained in:
Protesilaos Stavrou 2026-01-31 10:00:35 +02:00
parent 27456c3121
commit ea135519d3
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -6493,19 +6493,14 @@ If COLOR is unspecified, then return :box unspecified."
`(org-verse ((,c :inherit modus-themes-fixed-pitch :background ,bg-prose-block-contents :extend t)))
`(org-warning ((,c :foreground ,warning)))
;;;;; org-habit
;; NOTE 2025-11-12: We used to have `readable-foreground-color'
;; for the foreground values of these faces, but that function
;; breaks the theme if it is loaded in the early-init.el. Maybe
;; we can find a better solution. I do not want to introduce new
;; palette entries or a new function just for these faces though.
`(org-habit-alert-face ((,c :background ,bg-graph-yellow-0)))
`(org-habit-alert-future-face ((,c :background ,bg-graph-yellow-1)))
`(org-habit-clear-face ((,c :background ,bg-graph-blue-0)))
`(org-habit-clear-future-face ((,c :background ,bg-graph-blue-1)))
`(org-habit-overdue-face ((,c :background ,bg-graph-red-0)))
`(org-habit-overdue-future-face ((,c :background ,bg-graph-red-1)))
`(org-habit-ready-face ((,c :background ,bg-graph-green-0)))
`(org-habit-ready-future-face ((,c :background ,bg-graph-green-1)))
`(org-habit-alert-face ((,c :background ,bg-graph-yellow-0 :foreground ,(modus-themes-get-readable-foreground bg-graph-yellow-0))))
`(org-habit-alert-future-face ((,c :background ,bg-graph-yellow-1 :foreground ,(modus-themes-get-readable-foreground bg-graph-yellow-1))))
`(org-habit-clear-face ((,c :background ,bg-graph-blue-0 :foreground ,(modus-themes-get-readable-foreground bg-graph-blue-0))))
`(org-habit-clear-future-face ((,c :background ,bg-graph-blue-1 :foreground ,(modus-themes-get-readable-foreground bg-graph-blue-1))))
`(org-habit-overdue-face ((,c :background ,bg-graph-red-0 :foreground ,(modus-themes-get-readable-foreground bg-graph-red-0))))
`(org-habit-overdue-future-face ((,c :background ,bg-graph-red-1 :foreground ,(modus-themes-get-readable-foreground bg-graph-red-1))))
`(org-habit-ready-face ((,c :background ,bg-graph-green-0 :foreground ,(modus-themes-get-readable-foreground bg-graph-green-0))))
`(org-habit-ready-future-face ((,c :background ,bg-graph-green-1 :foreground ,(modus-themes-get-readable-foreground bg-graph-green-1))))
;;;;; org-journal
`(org-journal-calendar-entry-face ((,c :inherit modus-themes-slant :foreground ,date-common)))
`(org-journal-calendar-scheduled-face ((,c :inherit modus-themes-slant :foreground ,date-scheduled-subtle)))