unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: rms@gnu.org
Cc: luangruo@yahoo.com, Protesilaos Stavrou <info@protesilaos.com>,
	emacs-devel@gnu.org
Subject: Re: Automatic face setting based on contrast?
Date: Tue, 5 Oct 2021 19:10:48 -0400	[thread overview]
Message-ID: <CADwFkmnG_CaYieUj0Ar8oQ96AnUmVZjvc2CxD_vSTkN5VPEqSA@mail.gmail.com> (raw)
In-Reply-To: <E1mXrms-0005Z2-5h@fencepost.gnu.org>

Richard Stallman <rms@gnu.org> writes:

>   > I made this point in the above bug report, but there is no way to
>   > style Emacs with 25-50 face definitions.  It is very hard to put an
>   > exact number on this, as e.g. some faces are inherited and therefore
>   > more important, but realistically speaking you need at least twice
>   > that to have a somewhat decent coverage.
>
> Is this something that could be fixed, in principle?  Could a theme
> specify some faces manually, and then Emacs would adjust various other
> faces automatically so as to contrast with some of those?
>
> Currently, a face can inherit properties from another face.
> Could there be a kind of contrast-inheritance where face A
> is set automatically to contrast strongly with B, and contrast
> somewhat with C and D?  Based on calculations on the RGB codes,
> I imagine.
>
> This would call for a bit of research, but if we got it to work,
> specifying a good theme might become a lot easier.

I think it would be hard to find something "perfect", but if the goal is
to get something "good enough" or even just "a bit better", then it
sounds more achievable.

solarized themes has an interesting concept, where you only need to
specify a few base colors that the rest of the theme is calculated from.

So here's a theme definition:

;; inspired vim's jellybeans color-theme
(solarized-create-theme-file-with-palette 'light 'solarized-jellybeans-light
  '("#202020" "#ffffff"
    "#ffb964" "#8fbfdc" "#a04040" "#b05080" "#805090" "#fad08a"
"#99ad6a" "#8fbfdc"))

You can also override individual faces in case the algorithm fails.

I have no idea how well suited this approach is for general use, but I
suspect that you end up with a theme that fits within very specific
parameters.

Another idea is semantic faces.  For example, instead of just having the
face `info-title-1', we would have a general face `title1' that a face
in a mode that implements headlines would inherit from.  We obviously
already have some semantic faces, like `font-lock-doc-face', but the
concept could perhaps be developed.



  parent reply	other threads:[~2021-10-05 23:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87k0iub53g.fsf.ref@yahoo.com>
2021-10-03 13:38 ` Why has the light blue theme been made obsolete? Po Lu
2021-10-03 14:25   ` Stefan Kangas
2021-10-03 14:52     ` Stefan Kangas
2021-10-03 16:04       ` [External] : " Drew Adams
2021-10-17  4:04         ` Jean Louis
2021-10-17 11:30           ` Stefan Kangas
2021-10-17 17:08             ` Drew Adams
2021-10-17 17:32               ` Stefan Kangas
2021-10-17 19:24                 ` Drew Adams
2021-10-17 20:31                   ` Stefan Monnier
2021-10-17 22:53                     ` Drew Adams
2021-10-18  0:40                       ` Stefan Monnier
2021-10-17 17:07           ` Drew Adams
2021-10-05 21:15       ` Automatic face setting based on contrast? Richard Stallman
2021-10-05 21:20         ` Alexandre Garreau
2021-10-06 20:53           ` Richard Stallman
2021-10-05 23:00         ` [External] : " Drew Adams
2021-10-05 23:10         ` Stefan Kangas [this message]
2021-10-06  0:20           ` Po Lu
2021-10-06  1:01             ` Stefan Kangas
2021-10-07 22:22               ` Richard Stallman
2021-10-07 22:22           ` Richard Stallman
2021-10-08  0:49             ` Tim Cross
2021-10-08  6:57               ` Eli Zaretskii
2021-10-09  1:45                 ` Tim Cross
2021-10-09  7:38                   ` Eli Zaretskii
2021-10-09 23:29               ` Richard Stallman
2021-10-09 23:29               ` Richard Stallman
2021-10-06  1:39         ` Stefan Monnier
2021-10-07 12:32           ` Tyler Grinn
2021-10-07 12:52             ` Simon Pugnet
2021-10-07 13:36             ` Stefan Monnier
2021-10-07 22:23               ` Richard Stallman
2021-10-04  9:30   ` Why has the light blue theme been made obsolete? Lars Ingebrigtsen
2021-10-17  4:18     ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmnG_CaYieUj0Ar8oQ96AnUmVZjvc2CxD_vSTkN5VPEqSA@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=emacs-devel@gnu.org \
    --cc=info@protesilaos.com \
    --cc=luangruo@yahoo.com \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).