parchment
parchment copied to clipboard
A light editor theme for Vim and Emacs, inspired by Acme and Leuven – GitHub mirror
- Parchment
Parchment is an editor theme for Vim and Emacs, inspired by Acme and Leuven. You might like it if you prefer light colorschemes but think black-on-white is too hard on your eyes, or if you find most colorschemes too busy.
** Deprecation Notice
This theme is deprecated and will not be receiving further updates. The author is no longer using vim, and has switched to [[https://protesilaos.com/emacs/modus-themes][modus-themes]].
Vim users may like [[https://github.com/plan9-for-vimspace/acme-colors][acme-colors]] as an alternative.
Emacs users are encouraged to switch to =modus-operandi=, which can be configured to closely resemble =parchment= using the following snippet:
#+BEGIN_SRC emacs-lisp (use-package modus-themes :ensure t :init (setq modus-themes-italic-constructs t modus-themes-prompts '(background bold) modus-themes-completions '((selection . (accented intense)) (popup . (accented intense))) modus-themes-region '(bg-only no-extend) modus-themes-syntax '(green-strings yellow-comments) modus-themes-org-blocks 'gray-background modus-themes-org-agenda '((scheduled . uniform)) modus-themes-headings '((1 . ((height . 1.3) background monochrome overline)) (2 . (background overline rainbow)) (3 . (background overline rainbow)) (t . (rainbow))))
;; Load the theme files before enabling a theme
(modus-themes-load-themes)
:config
(defvar my-modus-themes-tinted-white-point "#ffffea"
"Custom white point to use in `modus-themes-tinted-mode'.")
(defun my-color-change-white-point (color white-point)
"Adjust COLOR to the reference WHITE-POINT."
(let* ((white-point-rgb (color-name-to-rgb white-point))
(white-point-xyz (apply #'color-srgb-to-xyz white-point-rgb))
(color-rgb (color-name-to-rgb color))
(color-xyz (apply #'color-srgb-to-xyz color-rgb))
(color-lab (apply #'color-xyz-to-lab color-xyz))
(result-xyz (apply #'color-lab-to-xyz
(append color-lab (list white-point-xyz))))
(result-rgb (apply #'color-xyz-to-srgb result-xyz))
(r (color-clamp (nth 0 result-rgb)))
(g (color-clamp (nth 1 result-rgb)))
(b (color-clamp (nth 2 result-rgb))))
(color-rgb-to-hex r g b 2)))
(defun my-modus-operandi-transform (_name hex)
"Transform color NAME with value HEX by adjusting its white point."
(my-color-change-white-point hex my-modus-themes-tinted-white-point))
(defun my-modus-vivendi-transform (name hex)
"Transform color NAME with value HEX by adjusting its white point.
If it's a background color, also lighten it a bit." (let ((hex* (if (string-prefix-p "bg-" (symbol-name name)) (color-lighten-name hex 10.0) hex))) (my-color-change-white-point hex* my-modus-themes-tinted-white-point)))
(defun my-modus-themes-tint-palette (palette transform)
"Modify Modus PALETTE by mapping TRANSFORM over each color."
(mapcar (lambda (color)
(let ((name (car color))
(hex (cdr color)))
(cons name
(funcall transform name hex))))
palette))
(define-minor-mode modus-themes-tinted-mode
"Tweak some Modus themes colors."
:init-value nil
:global t
(if modus-themes-tinted-mode
(setq modus-themes-operandi-color-overrides
(my-modus-themes-tint-palette modus-themes-operandi-colors
#'my-modus-operandi-transform)
modus-themes-vivendi-color-overrides
(my-modus-themes-tint-palette modus-themes-vivendi-colors
#'my-modus-vivendi-transform))
(setq modus-themes-operandi-color-overrides nil
modus-themes-vivendi-color-overrides nil)))
;; Apply custom color palette to modus-themes
(modus-themes-tinted-mode 1)
;; Load the theme of your choice:
(modus-themes-load-operandi))
#+END_SRC
** Screenshots
[[./img/emacs-org.png]]
[[./img/vim-go.png]]
** Installation
*** Emacs
**** MELPA
After [[https://melpa.org/#/getting-started][enabling installation]] of MELPA packages, install =parchment-theme= with ~M-x package-install~. Load it using ~load-theme~.
Or if you are using =use-package= (strongly recommended), simply add the following to your =init.el=:
#+BEGIN_SRC emacs-lisp (use-package parchment-theme :ensure t :config (load-theme 'parchment t)) #+END_SRC
**** Manual
To install =parchment-theme= for Emacs manually instead, first clone the repository to your local system:
#+BEGIN_SRC sh mkdir -p ~/.emacs.d/themes git clone https://github.com/ajgrf/parchment ~/.emacs.d/themes/parchment #+END_SRC
Then add the following to your =init.el= or =.emacs= file:
#+BEGIN_SRC emacs-lisp (add-to-list 'custom-theme-load-path "~/.emacs.d/themes") (load-theme 'parchment t) #+END_SRC
*** Vim
Parchment can be installed in the same way as most other vim plugins and colorschemes. If you don't have a preferred method of installing vim plugins, I recommend using [[https://github.com/tpope/vim-pathogen][pathogen]] to install parchment. Once pathogen is set up, just clone this repo into your bundle directory:
#+BEGIN_SRC sh git clone https://github.com/ajgrf/parchment ~/.vim/bundle/parchment #+END_SRC
** Terminal Colors
If your terminal does not support true colors, you will need to use a matching terminal theme, and ensure that it does not use bright colors for bold text. The following X resources accomplish that for xterm and urxvt:
#+BEGIN_SRC conf-xdefaults *background: #ffffea *foreground: #000000
*color0: #000000 *color1: #880000 *color2: #005500 *color3: #663311 *color4: #004488 *color5: #770077 *color6: #007777 *color7: #eeeecc *color8: #eaeaea *color9: #ffeaea *color10: #eaffea *color11: #eeee9e *color12: #cceeff *color13: #ffeaff *color14: #eaffff *color15: #ffffea
URxvtintensityStyles: false XTermboldColors: false #+END_SRC
** License
The files in this repository are licensed under a permissive ISC license. See the LICENSE file for more details.