Open
Conversation
This commit adds the default theme used in Emacs' terminal emulator modes (such as `ansi-term`) when running GUI Emacs without any configuration. The colour palette of this theme traces back through a long lineage, starting with the original `rgb.txt` distributed with X11 after its development at MIT. The exact names of who picked which colours here are unknown (people didn't spend as much time on version control 41 years ago), so I have attributed it to Jim Gettys (original X11 developer) & co. In Emacs source code, the colurs can be found in `lisp/term/tty-colors.el`, and are mapped to ANSI colours from there in `lisp/ansi-color.el`. I had to convert them from 16-bit colour space to the 8-bit colour space used by Alacritty (ironic, considering the relative age of the programs!). This was done using some Lisp and Python code which mapped the 16-bit RGB to LAB colour space, and back to 8-bit RGB. I experimented with multiple ways of doing this, and simple rounding or bit-shifting yielded visually unpleasing results, whereas the LAB-match is pretty accurate.
Author
Member
But it didn't… Those are clearly different colors, trivially verified by just looking at the images. I'm confused why you went through so much trouble when you can just get the rgb color codes from the images directly. Yellow for example is #cdcd00 in Emacs while being #c0c000 in your theme. |
chrisduerr
requested changes
Jul 4, 2025
Member
chrisduerr
left a comment
There was a problem hiding this comment.
These colors do not match your desired result.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This commit adds the default theme used in Emacs' terminal emulator modes (such as
ansi-term) when running GUI Emacs without any configuration.The colour palette of this theme traces back through a long lineage, starting with the original
rgb.txtdistributed with X11 after its development at MIT. The exact names of who picked which colours here are unknown (people didn't spend as much time on version control 41 years ago), so I have attributed it to Jim Gettys (original X11 developer) & co.In Emacs source code, the colurs can be found in
lisp/term/tty-colors.el, and are mapped to ANSI colours from there inlisp/ansi-color.el.I had to convert them from 16-bit colour space to the 8-bit colour space used by Alacritty (ironic, considering the relative age of the programs!).
This was done using some Lisp and Python code which mapped the 16-bit RGB to LAB colour space, and back to 8-bit RGB. I experimented with multiple ways of doing this, and simple rounding or bit-shifting yielded visually unpleasing results, whereas the LAB-match is pretty accurate.