GitHub - ajgrf/parchment: A vim colorscheme inspired by Acme and Leuven
source link: https://github.com/ajgrf/parchment
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.
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 modus-themes.
Vim users may like 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:
(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))
Screenshots
Installation
Emacs
MELPA
After 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
:
(use-package parchment-theme
:ensure t
:config (load-theme 'parchment t))
Manual
To install parchment-theme
for Emacs manually instead, first clone the
repository to your local system:
mkdir -p ~/.emacs.d/themes
git clone https://github.com/ajgrf/parchment ~/.emacs.d/themes/parchment
Then add the following to your init.el
or .emacs
file:
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'parchment t)
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 pathogen to install parchment. Once pathogen is set up, just clone this repo into your bundle directory:
git clone https://github.com/ajgrf/parchment ~/.vim/bundle/parchment
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:
*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 URxvt*intensityStyles: false XTerm*boldColors: false
License
The files in this repository are licensed under a permissive ISC license. See the LICENSE file for more details.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK