Some thoughts about org-habits faces
Hi Prot,
following discussion at #134 (closed), I open this issue to share some thoughts about org-habit
faces and some of the ways I choose to deal with them. The only purpose of this is that we can discuss the matter. If it turns out to be somehow useful to modus-themes
I'll be glad, of course, but there is no specific request or demand being done. That's just to say, please feel absolutely free as to how you choose to follow up on this.
I'm an user of org-habit
, I use it to track my sports activities, and like it very much for this purpose. And though I'm definitely not a "theme hopper" I have tried some things out at one point or another, and happen to know theming the faces for org-habit
is a particular hard corner of the task.
I think the challenge of it stems from some design choices of org-habit
and some common design choices of color themes, which are very sound in themselves, but sort of clash in this case. To be explicit. The author of org-habits
has chosen to use a set of 8 faces, covering presumably the conceivable use cases for the feature, and thus allowing for user configurability. Clearly commendable, I'd try to do the same in his place. Color themes, on their side, commonly try to keep consistency by defining a color palette which is a limited set of colors designed to cover cases of text syntax highlighting. All fine too, and I think we can easily agree that such procedure is well a prerequisite for consistency of the theme, and for "keeping things sane", if you will.
That given, choosing 8 different colors from a typical theme palette, in a way that makes sense for the habits performance graph, and so that these colors can be packed together in the graph and still be distinguishable between themselves is a very hard task. Depending on the theme, that might verge on an "impossible" task. On top of that, I'm not sure how many theme developers are org-habit
users, or if there are many users of it to provide feedback to developers. And I'd say it is not easy to grasp the faces meaning from it's docstring, if you are not familiar with the feature (I've certainly seen a number of confused folks about how to use org-habits).
As I mentioned, there are 8 faces for org-habit
: "clear", "ready", "alert", and "overdue", each with a "future" variant. Conceptually, "clear" means that doing the task on that day is too early, you'd be doing more frequently than intended if you did it that day. "Ready" means that you could do the task that day, and you'd still be on schedule, but you can delay it to a later date. "Alert" means that if you do the task that day you are still on schedule, but just so, if you wait another day, you'll be overdue. "Overdue", means if you do it that day it will be latter than intended.
As the default faces are set, "clear" is "blue", "ready" is "green", "alert" is "yellow", and "overdue" is "red". The future variants of each are set to different shades of these same colors. It makes sense. And the "meaning" of the colors (if there is such a thing) is intuitive.
That's the setting. I'll comment further on it latter, for now let's see what this means in practice for themes. No better way to see how some of them have solved this conundrum. (I'll give my own habits graph as example, I hope it's enough to illustrate).
Default theme:
Default dark theme (emacs --reverse-video
):
Solarized-light:
Solarized-dark:
Zenburn:
Gruvbox-light-hard:
Modus-operandi:
Modus-vivendi:
I think this is a good set of very solid themes for us to consider. And I think it is fair to say that this set illustrates well the initial point made that it is difficult for a theme to choose a good set of colors under the usual constrains. My personal view is that the result is typically way too noisy / busy. It calls too much attention to itself as a "block" in my agenda because of that. And it is also not very legible, to say the least. Of course, this is a personal opinion, and debatable.
The default theme is a good benchmark. We may argue aesthetics but, even if busy indeed, it is reasonably clear and intuitive by sticking to a "traffic-light metaphor" (plus blue). A number of the themes presented also follow this metaphor (modus-themes
doesn't) but in many cases they are harder to grasp than the default because the choices for "future" vs "normal" for each of the faces is subject to more strict constrains than the default, so its harder to pick a good meaningful color from the available theme palette.
My view on this problem has been for some time that the fact that org-habit
offers the possibility to distinguish 8 different faces does not mean we have to use all of those distinctions. And, as a matter of fact, if we drop down some of them, we can reach more legible and less noisy results. The obvious candidate, and the most fruitful one at that, is the distinction between each of the four base faces and their respective future variants. That information is already available to us by the position in the performance graph. "Today" is clearly marked by org-habit-today-glyph
, so it's easy to spot. Hence, just making each of the base faces the same as their future variant is a good simplification, which radically reduces the size of the problem by requiring us to choose just 4 colors instead of 8. But I went even further. My personal use of org-habit
is to track my sports activity, so its really not an issue if I choose to do something earlier than scheduled. Which means the difference between the "clear" face, and the "ready" face is not that important. Not sufficiently so that want to eliminate the distinction between them, but enough so that I can use just a shade of the same color. So I'm down to three colors and a shade of one of them. And, you will have guessed by now, I can stick to a strict "traffic-light metaphor", and keep the following note on my init file regarding my personal convention for org-habit
faces:
;; - clear(-future)-face: a lighter green (or darker on dark themes)
;; - ready(-future)-face: a darker green (or lighter on light themes)
;; - alert(-future)-face: some yellow
;; - overdue(-future)-face: some red
As to results, my take for modus-operandi:
Which was obtained with:
(advice-add
'load-theme :after
(defun gb/customize-theme-modus-operandi (_theme &rest _args)
(when (member 'modus-operandi custom-enabled-themes)
(let ((class '((class color) (min-colors 89))))
(custom-theme-set-faces
'modus-operandi
;; org-habit
`(org-habit-clear-face
((,class :background ,(modus-themes-color 'green-refine-bg)
:foreground ,(modus-themes-color 'green-refine-fg))))
`(org-habit-clear-future-face
((,class :background ,(modus-themes-color 'green-refine-bg)
:foreground ,(modus-themes-color 'green-refine-fg))))
`(org-habit-ready-face
((,class :background ,(modus-themes-color 'green-fringe-bg)
:foreground ,(modus-themes-color 'fg-dim))))
`(org-habit-ready-future-face
((,class :background ,(modus-themes-color 'green-fringe-bg)
:foreground ,(modus-themes-color 'fg-dim))))
`(org-habit-alert-face
((,class :background ,(modus-themes-color 'yellow-refine-bg)
:foreground ,(modus-themes-color 'yellow-refine-fg))))
`(org-habit-alert-future-face
((,class :background ,(modus-themes-color 'yellow-refine-bg)
:foreground ,(modus-themes-color 'yellow-refine-fg))))
`(org-habit-overdue-face
((,class :background ,(modus-themes-color 'red-intense-bg)
:foreground ,(modus-themes-color 'fg-main))))
`(org-habit-overdue-future-face
((,class :background ,(modus-themes-color 'red-intense-bg)
:foreground ,(modus-themes-color 'fg-main)))))))))
My take for solarized-light:
It is, of course, an opinionated and idiosyncratic take on the issue, as I admitted from the start. But I think the results speak for themselves.
From a practical perspective, out of all that, what I think may be somehow useful to modus-themes
? I believe that anything that diverges from the standard 8 different colors set will be hardly tenable as the default for any theme. So defaults will be stuck between a rock and a hard place, for the reasons exposed. However, if you do think org-habit
is a case important enough, or tricky enough, to be granted a user option, such as modus-themes-completions
or modus-themes-prompts
, then there would be space to fit in some improvements in this area. If that's the case, I also think the lowest hanging fruit, and the one from which there is the most to gain, is to move to a 4 color set, merging each face with it's "-future" variant. I'm willing to bet with you people will like it. Now, if this door were to be open, other alternatives could naturally also be included as desired: a three colored one, a different color set etc.
Again, I'm just sharing my thoughts on the subject, for you to use as you see fit, if you see fit. I'm well aware my preferences here are peculiar enough that they definitely belong in my init file. So please, be at ease as to how you wish to take upon this.
Well, of course, I'd also love to hear your thoughts on the matter.
Cheers!