branch: externals/modus-themes
commit 407bf5e5103e08934102819e8a0cfad1ebedc510
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    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.
---
 modus-themes.el | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/modus-themes.el b/modus-themes.el
index da86334d2f..19cba7ad21 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -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))))

Reply via email to