Make sure the org-habit faces always use a readable foreground

These faces are problematic because their colour coded background is
their essential quality. Having "readable" text here may be well below
the 7:1 contrast target. We have to do this otherwise we will need to
compromise on the background values, which makes them harder to tell
apart and thus less useful for what they are meant to do.
This commit is contained in:
Protesilaos Stavrou 2025-10-24 06:13:06 +03:00
parent b2e6d78d5f
commit 407bf5e510
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -6364,14 +6364,15 @@ FG and BG are the main colors."
`(org-verse ((,c :inherit org-block)))
`(org-warning ((,c :inherit warning)))
;;;;; org-habit
`(org-habit-alert-face ((,c :background ,bg-graph-yellow-0 :foreground "#000000"))) ; fg is special case
`(org-habit-alert-future-face ((,c :background ,bg-graph-yellow-1)))
`(org-habit-clear-face ((,c :background ,bg-graph-blue-0 :foreground "#000000"))) ; fg is special case
`(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 :foreground "#000000"))) ; fg is special case
`(org-habit-ready-future-face ((,c :background ,bg-graph-green-1)))
;; NOTE 2025-10-24: All foregrounds here are a special case.
`(org-habit-alert-face ((,c :background ,bg-graph-yellow-0 :foreground ,(readable-foreground-color bg-graph-yellow-0))))
`(org-habit-alert-future-face ((,c :background ,bg-graph-yellow-1 :foreground ,(readable-foreground-color bg-graph-yellow-1))))
`(org-habit-clear-face ((,c :background ,bg-graph-blue-0 :foreground ,(readable-foreground-color bg-graph-blue-0))))
`(org-habit-clear-future-face ((,c :background ,bg-graph-blue-1 :foreground ,(readable-foreground-color bg-graph-blue-1))))
`(org-habit-overdue-face ((,c :background ,bg-graph-red-0 :foreground ,(readable-foreground-color bg-graph-red-0))))
`(org-habit-overdue-future-face ((,c :background ,bg-graph-red-1 :foreground ,(readable-foreground-color bg-graph-red-1))))
`(org-habit-ready-face ((,c :background ,bg-graph-green-0 :foreground ,(readable-foreground-color bg-graph-green-0))))
`(org-habit-ready-future-face ((,c :background ,bg-graph-green-1 :foreground ,(readable-foreground-color 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 org-scheduled))))