38

GitHub - srcery-colors/srcery-emacs: Dark colorscheme for Emacs/Spacemacs. GUI a...

 4 years ago
source link: https://github.com/srcery-colors/srcery-emacs
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.org

img/title.png https://melpa.org/packages/srcery-theme-badge.svg https://stable.melpa.org/packages/srcery-theme-badge.svg

Colorscheme with clearly defined contrasting colors and a slightly earthy tone.

Requirements

Emacs 24 or above

GUI

Should work out of the box.

Terminal

To use Srcery in the terminal you need to change your terminal emulator’s so-called “ASCII” colors to the ones in the table below.

TERMCOLNRHEXRGBblack0#1C1B1928, 27, 25red1#EF2F27239, 47, 39green2#519F5081, 159, 80yellow3#FBB829251, 184, 41blue4#2C78BF44, 120, 191magenta5#E02C6D224, 44, 109cyan6#0AAEB310, 174, 179white7#918175145, 129, 117bright-black8#2D2C2945, 44, 41brright-red9#F75341247, 83, 65bright-green10#98BC37152, 188, 55bright-yellow11#FED06E254, 208, 110bright-blue12#68A8E4104, 168, 228bright-magenta13#FF5C8F255, 92, 143bright-cyan14#53FDE983, 253, 233bright-White15#FCE8C3252, 232, 195

See srcery-terminal repository for a list of terminal configs.

In addition to the table above Srcery uses a few unmodified xterm colors. Since most terminals have these defined it pads out the color selection nicely without over complicating things.

Make sure your $TERM supports 256 colors.

Installation

Package.el

Srcery is available from MELPA

M-x package-install RET srcery-theme

Then load it with

M-x load-theme srcery

Or add this to your init file:

(load-theme 'srcery t)

Spacemacs

Either install using package-install or add srcery-theme to dotspacemacs-additional-packages, then add srcery to dotspacemacs-themes

(setq-default
 dotspacemacs-additional-packages
 '(srcery-theme)
 dotspacemacs-themes
 '(srcery))

Screenshots

Lisp

img/lisp.png

Python / JavaScript

img/py-js.png

Rust / Magit

img/rs-magit.png

Org / C

img/org-c.png

Customization

Srcery has a couple of options that can be tweaked via M-x customize:

srcery-org-height

boolean, default: t

This toggles the use of varying org headings heights.

srcery-invert-matches

boolean, default: nil

Toggles whether to inverse-video search matches.

Make sure your cursor is inverted if this is enabled as otherwise it will make the cursor difficult to spot.

srcery-invert-region

boolean, default: t

Toggle inverse video for region

srcery-transparent-background

boolean, default nil

Sets the base background color to nil, and relies on underlying terminal background color. This only works in the terminal, and the idea behind it is that you can use for example tmux to control the background color.

Custom colors

Its possible to override the base srcery colors.

Possible colors are: srcery-black, srcery-red, srcery-green, srcery-yellow, srcery-blue, srcery-magenta, srcery-cyan, srcery-white srcery-bright-black, srcery-bright-red, srcery-bright-green, srcery-bright-yellow, srcery-bright-blue, srcery-bright-magenta, srcery-bright-cyan, srcery-bright-white srcery-orange, srcery-bright-orange, srcery-hard-black, srcery-gray-1, srcery-gray-2, srcery-gray-3, srcery-gray-4, srcery-gray-5.

Bear in mind that changing these will not work in termninal. Set your term colors to whatever you wish to override.

Supported modes

  • company
  • ein
  • erc
  • gnus
  • helm
  • ido
  • info
  • magit
  • mu4e
  • neotree
  • org
  • evil-snipe
  • paren-face
  • cider
  • dired
  • flycheck
  • ivy
  • latex
  • powerline
  • spaceline
  • and others, more coming

    I recommend paren-face and highlight-parentheses.el for lisp

Troubleshooting

Work in progress

This theme is a work in progress, if you see something that is off or doesn’t work please open an issue so it can be fixed.

org-bullets and transparent background

When setting the variable srcery-transparent-background and you are using org-bullets the leading asterisks are colored white, which does nothing to hide them. The problem is that org-bullets sets the :forground color to the default background color, but when this is nil this issue arise. I’ve made a fork that uses the org-hide face, fixing this issue. There is also an open pull request that addresses this.

Attribution

I’m new to elisp, so I used the spacemacs-theme as a base for emacs-srcery. Huge thanks to everyone involved with that theme, and Spacemacs itself. I also used Monokai Emacs as a blueprint for handling 256 colors properly. Big thanks to maintainers of that theme.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK