change name to lunarized

master
Jacopo De Simoi 7 years ago
parent 1f7aa08225
commit 40bb49cbb0
  1. 6
      Makefile
  2. 111
      README.md
  3. 2
      color-theme-solarized-pkg.el
  4. 42
      color-theme-solarized.el
  5. 6
      makepkg.sh
  6. 114
      solarized-definitions.el
  7. 8
      solarized-theme.el

@ -23,10 +23,10 @@ build :
"(if (< emacs-major-version 24) \
(progn \
(add-to-list 'load-path \"./\") \
(require 'color-theme-solarized) \
(color-theme-solarized)) \
(require 'color-theme-lunarized) \
(color-theme-lunarized)) \
(add-to-list 'custom-theme-load-path \"./\") \
(load-theme 'solarized t))"
(load-theme 'lunarized t))"
test-dep-1 :
@cd $(TEST_DIR) && \

@ -1,14 +1,19 @@
[![Stories in Ready](https://badge.waffle.io/sellout/emacs-color-theme-solarized.png?label=ready&title=Ready)](https://waffle.io/sellout/emacs-color-theme-solarized)
Solarized Colorscheme for Emacs
[![Stories in Ready](https://badge.waffle.io/sellout/emacs-color-theme-lunarized.png?label=ready&title=Ready)](https://waffle.io/sellout/emacs-color-theme-lunarized)
Lunarized Colorscheme for Emacs
===============================
Stolen from Ethan Schoonover <es@ethanschoonover.com> by Greg Pfeil <greg@technomadic.org>
Stolen from Ethan Schoonover <es@ethanschoonover.com> by Greg Pfeil
<greg@technomadic.org>. Desaturated [lunarized] version by Jacopo De
Simoi <wilderkde@gmail.com> All credit for the emacs adaptation go to
Greg Pfeil
Visit the [Solarized homepage]
------------------------------
See the [Solarized homepage] for screenshots,
details and colorscheme versions for Vim, Mutt, popular terminal emulators and
See the [Solarized homepage] for screenshots,
details and colorscheme versions for Vim, Mutt, popular terminal emulators and
other applications.
Screenshots
@ -19,14 +24,15 @@ Screenshots
Downloads
---------
If you have come across this colorscheme via the [Emacs-only repository] on
If you have come across this colorscheme via the [Emacs-only repository] on
github, see the link above to the Solarized homepage or visit the main [Solarized repository].
The [Emacs-only repository] is kept in sync with the main [Solarized repository]. Issues, bug reports, changelogs that are not specific to the Emacs implementation should be submitted to the main [Solarized repository].
[Solarized homepage]: http://ethanschoonover.com/solarized
[Solarized repository]: https://github.com/altercation/solarized
[Emacs-only repository]: https://github.com/sellout/emacs-color-theme-solarized
[Original Emacs-only repository]: https://github.com/sellout/emacs-color-theme-solarized
[Emacs-only repository]: https://github.com/wilderjds/emacs-color-theme-lunarized
[color-theme]: http://www.nongnu.org/color-theme
Installation & Usage
@ -34,20 +40,27 @@ Installation & Usage
### Emacs 24
1. Add the `emacs-color-theme-solarized` directory to your Emacs `custom-theme-load-path`.
2. Add `(load-theme 'solarized t)` to your Emacs init file.
1. Add the `emacs-color-theme-lunarized` directory to your Emacs `custom-theme-load-path`.
2. Add `(load-theme 'lunarized t)` to your Emacs init file.
3. Reload the init file, or restart Emacs.
### [color-theme] \(pre-Emacs 24\)
1. Download and install [color-theme].
2. Add the `emacs-color-theme-solarized` directory to your Emacs `load-path`.
3. Add `(require 'color-theme-solarized)` and `(color-theme-solarized)` to your Emacs init file (usually `~/.emacs`).
2. Add the `emacs-color-theme-lunarized` directory to your Emacs `load-path`.
3. Add `(require 'color-theme-lunarized)` and `(color-theme-lunarized)` to your Emacs init file (usually `~/.emacs`).
3. Reload the init file, or restart Emacs.
### all versions
To switch between the light and dark variations of Solarized, set the frame’s `background-mode`. This can be accomplished globally using `M-x customize-variable frame-background-mode` or on a per-frame basis with `(set-frame-parameter nil 'background-mode 'light)` (or `'dark`). If you're in a terminal, you must also set the terminal parameter with `(set-terminal-parameter nil 'background-mode 'light)` (or `'dark`). Remember to call `enable-theme` after changing the background mode to update the state of the theme.
To switch between the light and dark variations of Lunarized, set the
frame’s `background-mode`. This can be accomplished globally using
`M-x customize-variable frame-background-mode` or on a per-frame basis
with `(set-frame-parameter nil 'background-mode 'light)` (or `'dark`).
If you're in a terminal, you must also set the terminal parameter with
`(set-terminal-parameter nil 'background-mode 'light)` (or
`'dark`). Remember to call `enable-theme` after changing the
background mode to update the state of the theme.
This allows you to have a mix of light and dark frames. I tend to use light frames in the GUI and dark frames in my terminal, so I use the following code:
@ -57,98 +70,98 @@ This allows you to have a mix of light and dark frames. I tend to use light fram
(let ((mode (if (display-graphic-p frame) 'light 'dark)))
(set-frame-parameter frame 'background-mode mode)
(set-terminal-parameter frame 'background-mode mode))
(enable-theme 'solarized)))
(enable-theme 'lunarized)))
```
### IMPORTANT NOTE FOR TERMINAL USERS:
If you are going to use Solarized in Terminal mode (i.e. not in a GUI version
If you are going to use Lunarized in Terminal mode (i.e. not in a GUI version
like Cocoa or X11 Emacs), **please please please** consider setting your
terminal emulator's colorscheme to use the Solarized palette. The [Solarized
terminal emulator's colorscheme to use the Lunarized palette. The [Lunarized
repository] includes palettes for some popular terminal emulator as well as
Xdefaults; or you can download them from the official [Solarized homepage].
Xdefaults; or you can download them from the official [Lunarized homepage].
If you use this emacs color theme *without* having changed your emulator's
palette, you will need to configure Solarized to degrade its colorscheme to
palette, you will need to configure Lunarized to degrade its colorscheme to
a set compatible with the terminal's default limited 256 color palette
(whereas by using the terminal's 16 ANSI color values, you would
see the correct, specific values for the Solarized palette).
see the correct, specific values for the Lunarized palette).
Again, I recommend just changing your terminal colors to Solarized values
Again, I recommend just changing your terminal colors to Lunarized values
either manually or via one of the many terminal schemes available for import.
Advanced Configuration
----------------------
Solarized will work out of the box with just the instructions specified above
Lunarized will work out of the box with just the instructions specified above
but does include several variables that can be customized.
variable name default optional
--------------------------------------------
solarized-termcolors = 16 | 256
solarized-degrade = nil | t
solarized-bold = t | nil
solarized-underline = t | nil
solarized-italic = t | nil
solarized-contrast = normal| high, low
solarized-visibility = normal| high, low
solarized-broken-srgb= nil | t (see details for Mac behavior)
lunarized-termcolors = 16 | 256
lunarized-degrade = nil | t
lunarized-bold = t | nil
lunarized-underline = t | nil
lunarized-italic = t | nil
lunarized-contrast = normal| high, low
lunarized-visibility = normal| high, low
lunarized-broken-srgb= nil | t (see details for Mac behavior)
--------------------------------------------
### Option Details
* solarized-termcolors
* lunarized-termcolors
Some 256-color terminals also allow you to set and use the standard 16
colors in addition to the fixed 256-color palette. This option only
applies when your terminal is in 256-color mode. If set to 16 (the
default) it will try to use the exact Solarized colors (assuming that
you've set these colors to the correct Solarized values either manually or
default) it will try to use the exact Lunarized colors (assuming that
you've set these colors to the correct Lunarized values either manually or
by importing one of the many colorscheme available for popular
terminal emulators). If it’s set to 256, then Solarized will use a
degraded version of the Solarized palette by displaying the closest colors
terminal emulators). If it’s set to 256, then Lunarized will use a
degraded version of the Lunarized palette by displaying the closest colors
in the terminal's default 256 colors as shown in [Xterm's color
chart](http://en.wikipedia.org/wiki/File:Xterm_color_chart.png).
* solarized-degrade
* lunarized-degrade
For test purposes only; in GUI mode, this forces Solarized to use the 256
For test purposes only; in GUI mode, this forces Lunarized to use the 256
degraded color mode to test the approximate color values for accuracy.
* solarized-bold | solarized-underline | solarized-italic
* lunarized-bold | lunarized-underline | lunarized-italic
If you wish to stop Solarized from displaying bold, underlined or
If you wish to stop Lunarized from displaying bold, underlined or
italicized typefaces, simply set the appropriate variable to `nil`.
* solarized-contrast
* lunarized-contrast
Stick with normal! It's been carefully tested. Setting this option to high
or low does use the same Solarized palette but simply shifts some values
Stick with normal! It's been carefully tested. Setting this option to high
or low does use the same Lunarized palette but simply shifts some values
up or down in order to expand or compress the tonal range displayed.
* solarized-visibility
* lunarized-visibility
Special characters such as trailing whitespace, tabs, newlines, when
displayed using `:set list` can be set to one of three levels depending on
displayed using `:set list` can be set to one of three levels depending on
your needs. Default value is `normal` with `high` and `low` options.
* solarized-broken-srgb
* lunarized-broken-srgb
Emacs [bug #8402](http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8402)
results in incorrect color handling on Macs. If you are using Emacs on a
Mac, we try to determine this value automatically. If this is `t` (the
default on Macs), Solarized works around it with alternative colors.
default on Macs), Lunarized works around it with alternative colors.
However, these colors are not totally portable, so you may be able to edit
the "Gen RGB" column in `solarized-definitions.el` to improve them further.
the "Gen RGB" column in `lunarized-definitions.el` to improve them further.
Code Notes
----------
I have attempted to modularize the creation of Emacs colorschemes in this script and, while it could be refactored further, it should be a good foundation for the creation of any color scheme. By simply changing the values in the `solarized-colors` table in `solarized-definitions.el` and testing in a GUI Emacs, you can rapidly prototype new colorschemes without diving into the weeds of line-item editing each syntax highlight declaration.
I have attempted to modularize the creation of Emacs colorschemes in this script and, while it could be refactored further, it should be a good foundation for the creation of any color scheme. By simply changing the values in the `lunarized-colors` table in `lunarized-definitions.el` and testing in a GUI Emacs, you can rapidly prototype new colorschemes without diving into the weeds of line-item editing each syntax highlight declaration.
The Values
----------
L\*a\*b values are canonical (White D65, Reference D50), other values are
L\*a\*b values are canonical (White D65, Reference D50), other values are
matched in sRGB space.
SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
@ -169,7 +182,7 @@ matched in sRGB space.
blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82
cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63
green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60
### Bug Reporting
Here are some things to keep in mind when submitting a bug report:

@ -1 +1 @@
(define-package "color-theme-solarized" "%%version%%" "Solarized themes for Emacs" '((color-theme "6.5.5")))
(define-package "color-theme-lunarized" "%%version%%" "Lunarized themes for Emacs" '((color-theme "6.5.5")))

@ -1,5 +1,5 @@
;;; Author: Ethan Schoonover, Solarized; Greg Pfeil, Emacs adaptation
;;; URL: http://ethanschoonover.com/solarized
;;; Author: Ethan Schoonover, Lunarized; Greg Pfeil, Emacs adaptation
;;; URL: http://ethanschoonover.com/lunarized
;;; This file is not (YET) part of GNU Emacs.
@ -8,45 +8,45 @@
;;; 1. Install the color-theme package
;;; (http://www.emacswiki.org/cgi-bin/wiki/ColorTheme)
;;; 2. Load this file
;;; 3. M-x color-theme-solarized
;;; 3. M-x color-theme-lunarized
(let ((current-file-name (or load-file-name buffer-file-name)))
(if current-file-name
(let* ((reqname (concat (file-name-directory current-file-name)
"solarized-definitions.el"))
"lunarized-definitions.el"))
(compreqname (concat reqname "c")))
(require 'solarized-definitions
(require 'lunarized-definitions
(if (file-exists-p compreqname) compreqname reqname)))
(require 'solarized-definitions)))
(require 'lunarized-definitions)))
(eval-when-compile
(require 'color-theme))
;;;###autoload
(defun color-theme-solarized ()
(defun color-theme-lunarized ()
"Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/lunarized."
(interactive)
(color-theme-install
`(color-theme-solarized () () ,@(solarized-color-definitions))))
`(color-theme-lunarized () () ,@(lunarized-color-definitions))))
(when (boundp 'color-themes)
(add-to-list 'color-themes
`(color-theme-solarized
"Solarized"
,solarized-description)))
`(color-theme-lunarized
"Lunarized"
,lunarized-description)))
;;;###autoload
(defun color-theme-solarized-dark ()
(defun color-theme-lunarized-dark ()
"Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
(declare (obsolete color-theme-solarized "2013-05-01"))
(color-theme-solarized))
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/lunarized."
(declare (obsolete color-theme-lunarized "2013-05-01"))
(color-theme-lunarized))
;;;###autoload
(defun color-theme-solarized-light ()
(defun color-theme-lunarized-light ()
"Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
(declare (obsolete color-theme-solarized "2013-05-01"))
(color-theme-solarized))
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/lunarized."
(declare (obsolete color-theme-lunarized "2013-05-01"))
(color-theme-lunarized))
(provide 'color-theme-solarized)
(provide 'color-theme-lunarized)

@ -7,11 +7,11 @@ if [ "$version" = "" ]; then
fi
echo "version = $version"
dir="color-theme-solarized-${version}"
dir="color-theme-lunarized-${version}"
mkdir $dir
cp *.el $dir
sed -i "s/%%version%%/$version/" "$dir/color-theme-solarized-pkg.el"
sed -i "s/%%version%%/$version/" "$dir/color-theme-lunarized-pkg.el"
tar cf color-theme-solarized-${version}.tar $dir
tar cf color-theme-lunarized-${version}.tar $dir

@ -4,70 +4,70 @@
(defalias 'cl-case 'case))
)
(defconst solarized-description
(defconst lunarized-description
"Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized.")
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/lunarized.")
(defcustom solarized-termcolors 16
"This is set to 16 by default, meaning that Solarized will attempt to use the
(defcustom lunarized-termcolors 16
"This is set to 16 by default, meaning that Lunarized will attempt to use the
standard 16 colors of your terminal emulator. You will need to set those colors
to the correct Solarized values either manually or by importing one of the many
to the correct Lunarized values either manually or by importing one of the many
colorscheme available for popular terminal emulators and Xdefaults."
:type 'integer
:options '(16 256)
:group 'solarized)
:group 'lunarized)
(defcustom solarized-degrade nil
"For test purposes only; when in GUI mode, forces Solarized to use the 256
(defcustom lunarized-degrade nil
"For test purposes only; when in GUI mode, forces Lunarized to use the 256
degraded color mode to test the approximate color values for accuracy."
:type 'boolean
:group 'solarized)
:group 'lunarized)
(defcustom solarized-diff-mode 'normal
(defcustom lunarized-diff-mode 'normal
"Sets the level of highlighting to use in diff-like modes."
:type 'symbol
:options '(high normal low)
:group 'solarized)
:group 'lunarized)
(defcustom solarized-bold t
"Stops Solarized from displaying bold when nil."
(defcustom lunarized-bold t
"Stops Lunarized from displaying bold when nil."
:type 'boolean
:group 'solarized)
:group 'lunarized)
(defcustom solarized-underline t
"Stops Solarized from displaying underlines when nil."
(defcustom lunarized-underline t
"Stops Lunarized from displaying underlines when nil."
:type 'boolean
:group 'solarized)
:group 'lunarized)
(defcustom solarized-italic t
"Stops Solarized from displaying italics when nil."
(defcustom lunarized-italic t
"Stops Lunarized from displaying italics when nil."
:type 'boolean
:group 'solarized)
:group 'lunarized)
(defcustom solarized-contrast 'normal
(defcustom lunarized-contrast 'normal
"Stick with normal! It's been carefully tested. Setting this option to high or
low does use the same Solarized palette but simply shifts some values up or
low does use the same Lunarized palette but simply shifts some values up or
down in order to expand or compress the tonal range displayed."
:type 'symbol
:options '(high normal low)
:group 'solarized)
:group 'lunarized)
(defcustom solarized-broken-srgb
(defcustom lunarized-broken-srgb
(if (and (eq system-type 'darwin) (eq window-system 'ns))
(not (and (boundp 'ns-use-srgb-colorspace)
ns-use-srgb-colorspace))
nil)
"Emacs bug #8402 results in incorrect color handling on Macs. If this is t
\(the default on Macs), Solarized works around it with alternative colors.
\(the default on Macs), Lunarized works around it with alternative colors.
However, these colors are not totally portable, so you may be able to edit
the \"Gen RGB\" column in solarized-definitions.el to improve them further."
the \"Gen RGB\" column in lunarized-definitions.el to improve them further."
:type 'boolean
:group 'solarized)
:group 'lunarized)
;; FIXME: The Generic RGB colors will actually vary from device to device, but
;; hopefully these are closer to the intended colors than the sRGB values
;; that Emacs seems to dislike
(defvar solarized-colors ; ANSI(Solarized terminal)
(defvar lunarized-colors ; ANSI(Lunarized terminal)
;; name sRGB Gen RGB 256 16 8
'((base03 "#262626" "#1c1c1c" "#1c1c1c" "brightblack" "black")
(base02 "#303030" "#242424" "#262626" "black" "black")
@ -85,13 +85,13 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
(blue "#268bd2" "#2075c7" "#0087ff" "blue" "blue")
(cyan "#2aa198" "#259185" "#00afaf" "cyan" "cyan")
(green "#859900" "#728a05" "#5f8700" "green" "green"))
"This is a table of all the colors used by the Solarized color theme. Each
"This is a table of all the colors used by the Lunarized color theme. Each
column is a different set, one of which will be chosen based on term
capabilities, etc.")
(defun solarized-face-for-index (facespec index &optional light)
(defun lunarized-face-for-index (facespec index &optional light)
"Creates a face from facespec where the colors use the names from
`solarized-colors`."
`lunarized-colors`."
(let ((new-fontspec (copy-sequence facespec)))
(dolist (property '(:foreground :background :color))
(let ((color-name (plist-get new-fontspec property)))
@ -121,53 +121,53 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
(otherwise color-name))))
(plist-put new-fontspec
property
(nth index (assoc color-name solarized-colors))))))
(nth index (assoc color-name lunarized-colors))))))
(when (plist-get new-fontspec :box)
(plist-put new-fontspec
:box
(solarized-face-for-index (plist-get new-fontspec :box) index
(lunarized-face-for-index (plist-get new-fontspec :box) index
light)))
new-fontspec))
(defun create-face-spec (name facespec)
`(,name ((((background dark) (type graphic))
,(solarized-face-for-index facespec
(cond (solarized-degrade 3)
(solarized-broken-srgb 2)
,(lunarized-face-for-index facespec
(cond (lunarized-degrade 3)
(lunarized-broken-srgb 2)
(t 1))))
(((background dark) (type tty) (min-colors 256))
,(solarized-face-for-index facespec
(if (= solarized-termcolors 16) 4 3)))
,(lunarized-face-for-index facespec
(if (= lunarized-termcolors 16) 4 3)))
(((background dark) (type tty) (min-colors 16))
,(solarized-face-for-index facespec 4))
,(lunarized-face-for-index facespec 4))
(((background dark) (type tty) (min-colors 8))
,(solarized-face-for-index facespec 5))
,(lunarized-face-for-index facespec 5))
(((background light) (type graphic))
,(solarized-face-for-index facespec
(cond (solarized-degrade 3)
(solarized-broken-srgb 2)
,(lunarized-face-for-index facespec
(cond (lunarized-degrade 3)
(lunarized-broken-srgb 2)
(t 1))
t))
(((background light) (type tty) (min-colors 256))
,(solarized-face-for-index facespec
(if (= solarized-termcolors 16) 4 3)
,(lunarized-face-for-index facespec
(if (= lunarized-termcolors 16) 4 3)
t))
(((background light) (type tty) (min-colors 16))
,(solarized-face-for-index facespec 4 t))
,(lunarized-face-for-index facespec 4 t))
(((background light) (type tty) (min-colors 8))
,(solarized-face-for-index facespec 5 t)))))
,(lunarized-face-for-index facespec 5 t)))))
(defun solarized-color-definitions ()
(let ((bold (if solarized-bold 'bold 'unspecified))
(bright-bold (if solarized-bold 'unspecified 'bold))
(underline (if solarized-underline t 'unspecified))
(defun lunarized-color-definitions ()
(let ((bold (if lunarized-bold 'bold 'unspecified))
(bright-bold (if lunarized-bold 'unspecified 'bold))
(underline (if lunarized-underline t 'unspecified))
(opt-under 'unspecified)
(italic (if solarized-italic 'italic 'unspecified)))
(cond ((eq 'high solarized-contrast)
(italic (if lunarized-italic 'italic 'unspecified)))
(cond ((eq 'high lunarized-contrast)
(let ((orig-base3 base3))
(rotatef base01 base00 base0 base1 base2 base3)
(setf base3 orig-base3)))
((eq 'low solarized-contrast)
((eq 'low lunarized-contrast)
(setf back base02
opt-under t)))
(let ((bg-back '(:background back))
@ -285,7 +285,7 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
(custom-state (,@fg-green))
(custom-variable-tag (,@fg-base1))
;; diff - DiffAdd, DiffChange, DiffDelete, and DiffText
,@(cl-case solarized-diff-mode
,@(cl-case lunarized-diff-mode
(high
`((diff-added (,@fmt-revr ,@fg-green))
(diff-changed (,@fmt-revr ,@fg-yellow))
@ -799,11 +799,11 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
(add-to-list 'custom-theme-load-path
(file-name-as-directory (file-name-directory load-file-name))))
(defmacro create-solarized-theme (name description color-definitions)
(defmacro create-lunarized-theme (name description color-definitions)
`(progn
(deftheme ,name ,description)
(apply 'custom-theme-set-faces
',name ,color-definitions)
(provide-theme ',name)))
(provide 'solarized-definitions)
(provide 'lunarized-definitions)

@ -1,6 +1,6 @@
(require 'solarized-definitions
(locate-file "solarized-definitions.el" custom-theme-load-path
(require 'lunarized-definitions
(locate-file "lunarized-definitions.el" custom-theme-load-path
'("c" "")))
(create-solarized-theme solarized
solarized-description (solarized-color-definitions))
(create-lunarized-theme lunarized
lunarized-description (lunarized-color-definitions))

Loading…
Cancel
Save