emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dependent colours


From: Eli Zaretskii
Subject: Re: Dependent colours
Date: Fri, 15 Apr 2022 12:32:05 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 15 Apr 2022 10:46:03 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Anyway, colors in Emacs are face attributes.
> 
> Colours are colours, but we usually use the face machinery to specify
> them, and we (almost always) instantiate them on the screen via the face
> machinery.  That doesn't mean that colours per se are face attributes.

I'm probably missing something: what other means do we have in Emacs
to produce colors on display, except via faces?

> :column-colors '("red" "blue")
> :row-colors '("green" "yellow")
> 
> and that's it.  But pondering this a bit more, perhaps using faces here
> would be nicer anyway -- the package writer may be wanting to use
> alternating foreground colours on the rows anyway.  So
> 
> :column-colors '((:background "red") (:background "blue"))
> :row-colors '((:foreground "green") (:foreground "yellow"))
> 
> is more expressive.  (And vtable will just have to check both foreground
> and background colours on the faces and blend accordingly, but that's
> just a small matter of programming.)
> 
> And besides, using faces for things like this has the advantage of
> fitting into the theming architecture.  I mean, if it's
> 
> :column-colors '(list-timer-column-even list-timer-column-odd)
> 
> and those are faces, we don't have to extend the theming machinery to
> handle theming of colours.

If what you have in mind can play nicely with faces (and I think it
can, but I'm not yet sure I understand the issue, see above), then
yes, using face machinery is the best, as we have there a lot of
functionalities that can be used without effort.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]