Add emacs default theme #154
Open
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.