Reducing the brightness of normal text without affecting other elements #41
antoineco
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have found the colors of the colorscheme to be quite calming for longer coding sessions in general. However, one thing has been bothering me: I find the normal foreground-on-background contrast in dark mode to be as bright as the sun, even with the
soft
background option. This has been especially perceptible to me while writing long-form text, like in Markdown documents.I had been rolling with a modified
fg
color alone for a while, originally:However, this change had a ripple effect since secondary
fg
values are determined based on the value ofcolors.fg
:mellifluous.nvim/lua/mellifluous/utils/shader.lua
Lines 25 to 27 in 234c05d
That snippet above made me aware of the existence of
shades_fg
, which is currently used only in thealduin
color set but can be used to achieve what I wanted to do, without affecting UI elements:I thought I could share that little trick here, since it allows darkening the normal text a little bit without darkening anything else, and without having to override highlight groups individually (built-in, Tree-sitter, LSP semantic highlights, ...). Thanks Ramojus for having this built-in! 🙌
Here is the result (I used a humongous font size on purpose):
before
after
Despite the darkened
fg
, the difference withfg2
remains noticeable.Beta Was this translation helpful? Give feedback.
All reactions