Skip to content

Face definition by indirection — define base16 named colors, or faces to inherit from? #106

@cben

Description

@cben

I'd like to tweak some things, e.g. the mode line, and maybe style some things not currently styled. But if I use customize-face I see the colors controlled by base16 already resolved to fixed colors such as #93a1a1, and I can only replace them by another fixed color — they'll not change when I flip between face16 themes.

IIUC if I want to change a face to parametric e.g. "use base0B background, whatever it is", the current solution is to fork base16-theme-define?
This is consistent with the base16 concept of a "builder", generating a theme of fixed colors, but in Emacs I think we can do better by adding indirection 💡

  • First improvement I can think of is to add a customizable variable that will be combined with fixed list in base16-theme-define. Or did I miss something like that?
    But that's still requires finding it, not using normal emacs mechanisms to define faces...

  • Can we define named colors? I can customize a face to have :background "light coral", can we extend that list so one could do :background "base09"?

    https://www.gnu.org/software/emacs/manual/html_node/elisp/Color-Names.html — hmm these all sound like named colors are read-only :-(

  • Alternative: can we define 16 base faces setting foreground to one of these colors + 16 base faces setting background to one of those?

    • And then change theming to use fixed face definitions inheriting from 1 or 2 of those base faces, only re-defining those 32 faces when switching themes?
      This is optional, but would improve discoverability — if I inspect/customize say font-lock-function-name-face, I'd see it's defined to inherit from "foreground-base0D", not #268bd2...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions