From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Dependent colours Date: Fri, 15 Apr 2022 12:32:05 +0300 Message-ID: <835yna3d62.fsf@gnu.org> References: <8735ifom48.fsf@gnus.org> <83y2073hen.fsf@gnu.org> <87sfqflqe2.fsf@gnus.org> <83v8vb3au2.fsf@gnu.org> <87czhjk5h7.fsf@gnus.org> <83pmlj3a7p.fsf@gnu.org> <8735ieivjo.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6015"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 15 11:33:12 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfIKF-0001Jn-PC for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Apr 2022 11:33:11 +0200 Original-Received: from localhost ([::1]:60196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfIKE-0005Zl-A7 for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Apr 2022 05:33:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfIJ0-0004mz-21 for emacs-devel@gnu.org; Fri, 15 Apr 2022 05:31:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfIIz-0002U2-Ng; Fri, 15 Apr 2022 05:31:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Jjic5EyMasfkmpSZhhQl+ErOy9c66aaQ+abNB7xQ/Kg=; b=XGn69IywyME9 RtfFQ6pooLM/CqcV1UDySpBZZBmkWS6W/Z3cw00FY7QmkhlZGku+a4HGxR/+V7/64osly2XfgcG03 gNda4NSvgOvFXqIUeGDfm0OJDETXkhSj43hzy/VJopcD4ZsUYr9J3oSh9rTtR4LtEfM315smnDKUA zuvsTkKBxhFhRWvRgM/V+Ey3vAdQBZP6py/EVhwYyb3EI6ShFUABjf6lUkWC2ey8mVs1TVyvPlDSK XQ0y+ZBSCfQAW/qnhhEoRyZYtxxyxzm3Fb/aIlgznqSzrGbrpB9wZ6oLwft0Oxseb0Rikf5ldQqe3 f+yKm0OReFYGi1Vy69U99w==; Original-Received: from [87.69.77.57] (port=3745 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfIIz-00058V-6U; Fri, 15 Apr 2022 05:31:53 -0400 In-Reply-To: <8735ieivjo.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 15 Apr 2022 10:46:03 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288428 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Fri, 15 Apr 2022 10:46:03 +0200 > > Eli Zaretskii 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.