Replaced the README with something more Emacs-specific. It still doesn't align with reality 100%, but should be a lot closer.

This commit is contained in:
Greg Pfeil 2011-04-23 17:50:57 -04:00
parent be5fed9e3e
commit 87c7f8fdb3
1 changed files with 75 additions and 222 deletions

297
README.md
View File

@ -1,254 +1,107 @@
Solarized
=========
Solarized Colorscheme for Emacs
===============================
### [See official homepage for full content](http://ethanschoonover.com/solarized)
Stolen from Ethan Schoonover <es@ethanschoonover.com> by Greg Pfeil <greg@technomadic.org>
## Precision colors for machines and people
Visit the [Solarized homepage]
------------------------------
[![solarized dualmode](https://github.com/altercation/solarized/raw/master/img/solarized-yinyang.png)](#features)\
Solarized is a sixteen color palette (eight monotones, eight accent colors)
designed for use with terminal and gui applications. It has several [unique
properties](#features). I designed this colorscheme with both precise
[CIELAB](http://en.wikipedia.org/wiki/Lab_color_space) lightness relationships
and a refined set of hues based on fixed color wheel relationships. It has been
tested extensively in real world use on color calibrated displays (as well as
uncalibrated/intentionally miscalibrated displays) and in a variety of lighting
conditions.
![solarized palette](https://github.com/altercation/solarized/raw/master/img/solarized-palette.png)\
Currently available in formats for (cf [screenshots](#screenshots) below):
* **Vim** (the Vim-only portion of Solarized is [available
here](https://github.com/altercation/vim-colors-solarized), for use with
Pathogen, etc.)
* **Mutt** e-mail client (*just* the Mutt colorscheme is [available
here](https://github.com/altercation/mutt-colors-solarized))
* **Xresources** / Xdefaults
* **iTerm2**
* OS X **Terminal.app**
* Adobe Photoshop Palette (inc. L\*a\*b values)
* Apple Color Picker Palette
* GIMP Palette
Don't see the application you want to use it in? Download the palettes (or pull
the values from the table below) and create your own. Submit it back and I'll
happily note the contribution and include it on this page.
**Note:** I am still tweaking the Vim highlighting for specific syntaxes and
welcome feedback on these.
Download
--------
### [Click here to download latest version](http://ethanschoonover.com/files/solarized/solarized.tar.gz)
Or use the following links to access application specific downloads and git
repositories:
* **Git repo:**
The full git repository is at: <https://github.com/altercation/solarized>
Get it using the following command:
$ git clone git://github.com/altercation/solarized.git
* **Vim only:**
The vim-only colorscheme (Pathogen ready) is available at:
<https://github.com/altercation/vim-colors-solarized>.
$ git clone git://github.com/altercation/vim-colors-solarized.git
You can also download it from [vim.org](http://www.vim.org/scripts/script.php?script_id=3520).
* **Mutt only:**
The mutt-only variants can be cloned from
<https://github.com/altercation/mutt-colors-solarized>
$ git clone git://github.com/altercation/mutt-colors-solarized.git
* **Canonical Project Page:**
Downloads, screenshots and more information are always available from the
project page: <http://ethanschoonover.com/solarized>
Note that through the magic of
[git-subtree](https://github.com/apenwarr/git-subtree) these repositories are
all kept in sync, so you can pull any of them and get the most up-to-date
version.
Features
--------
1. **Selective contrast**
On a sunny summer day I love to read a book outside. Not right in the sun;
that's too bright. I'll hunt for a shady spot under a tree. The shaded
paper contrasts with the crisp text nicely. If you were to actually measure
the contrast between the two, you'd find it is much lower than black text
on a white background (or white on black) on your display device of choice.
Black text on white from a computer display is akin to reading a book in
direct sunlight and tires the eye.
![solarized selective contrast](https://github.com/altercation/solarized/raw/master/img/solarized-selcon.png)\
Solarized reduces *brightness contrast* but, unlike many low contrast
colorschemes, retains *contrasting hues* (based on colorwheel relations)
for syntax highlighting readability.
2. **Both sides of the force**
![solarized dualmode](https://github.com/altercation/solarized/raw/master/img/solarized-dualmode.png)\
I often switch between dark and light modes when editing text and code.
Solarized retains the same selective contrast relationships and overall
feel when switching between the light and dark background modes. A *lot* of
thought, planning and testing has gone into making both modes feel like
part of a unified colorscheme.
3. **16/5 palette modes**
![solarized palettes](https://github.com/altercation/solarized/raw/master/img/solarized-165.png)\
Solarized works as a sixteen color palette for compatibility with common
terminal based applications / emulators. In addition, it has been carefull
designed to scale down to a variety of five color palettes (four base
monotones plus one accent color) for use in design work such as web design.
In every case it retains a strong personality but doesn't overwhelm.
5. **Precision, symmetry**
![solarized symmetry](https://github.com/altercation/solarized/raw/master/img/solarized-sym.png)\
The monotones have symmetric CIELAB lightness differences, so switching
from dark to light mode retains the same perceived contrast in brightness
between each value. Each mode is equally readable. The accent colors are
based off specific colorwheel relations and subsequently translated to
CIELAB to ensure perceptual uniformity in terms of lightness. The hues
themselves, as with the monotone \*a\*b values, have been adjusted within
a small range to achieve the most pleasing combination of colors.
This makes colorscheme inversion trivial. Here, for instance, is a sass
(scss) snippet that inverts solarized based on the class of the html tag
(e.g. `<html class="dark red">` to give a dark background with red accent):
$base03: #002b36;
$base02: #073642;
$base01: #586e75;
$base00: #657b83;
$base0: #839496;
$base1: #93a1a1;
$base2: #eee8d5;
$base3: #fdf6e3;
$yellow: #b58900;
$orange: #cb4b16;
$red: #d30102;
$magenta: #d33682;
$violet: #6c71c4;
$blue: #268bd2;
$cyan: #2aa198;
$green: #859900;
@mixin rebase($rebase03,$rebase02,$rebase01,$rebase00,$rebase0,$rebase1,$rebase2,$rebase3)
{
background-color:$rebase03;
color:$rebase0;
* { color:$rebase0; }
h1,h2,h3,h4,h5,h6 { color:$rebase1; border-color: $rebase0; }
a, a:active, a:visited { color: $rebase1; }
}
@mixin accentize($accent) {
a, a:active, a:visited, code.url { color: $accent; }
h1,h2,h3,h4,h5,h6 {color:$accent}
}
/* light is default mode, so pair with general html definition */
html, .light { @include rebase($base3,$base2,$base1,$base0,$base00,$base01,$base02,$base03)}
.dark { @include rebase($base03,$base02,$base01,$base00,$base0,$base1,$base2,$base3)}
html * {
color-profile: sRGB;
rendering-intent: auto;
}
Installation
------------
Installation instructions for each version of the colorscheme are included in
the subdirectory README files. Note that for Vim (and possibly for Mutt) you
may want to clone the specific repository (for instance if you are using
Pathogen). See the links at the top of this file.
Font Samples
------------
Solarized has been designed to handle fonts of various weights and retain
readability, from the classic Terminus to the beefy Menlo.
![font samples - light](https://github.com/altercation/solarized/raw/master/img/solarized-fontsamples-light.png)
![font samples - dark](https://github.com/altercation/solarized/raw/master/img/solarized-fontsamples-dark.png)
Clockwise from upper left: Menlo, Letter Gothic, Terminus, Andale Mono
See the [Solarized homepage] for screenshots,
details and colorscheme versions for Vim, Mutt, popular terminal emulators and
other applications.
Screenshots
-----------
Click to view.
![solarized dark](https://github.com/altercation/solarized/raw/master/img/solarized-vim.png)
### Mutt
Downloads
---------
[![mutt dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-mutt-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-mutt-dark.png)
[![mutt light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-mutt-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-mutt-light.png)
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].
### C (Vim)
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].
[![c dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-c-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-c-dark.png)
[![c light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-c-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-c-light.png)
[Solarized homepage]: http://ethanschoonover.com/solarized
[Solarized repository]: https://github.com/altercation/solarized
[Emacs-only repository]: https://github.com/sellout/emacs-color-theme-solarized
[color-theme]: http://www.nongnu.org/color-theme
### Haskell (Vim)
Installation & Usage
--------------------
[![haskell dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-haskell-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-haskell-dark.png)
[![haskell light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-haskell-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-haskell-light.png)
### Emacs 24
### HTML (Vim)
1. Add the `emacs-color-theme-solarized` directory to your Emacs `load-path`.
2. `M-x enable-theme`, then either `solarized-light` or `solarized-dark`.
[![html dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-html-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-html-dark.png)
[![html light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-html-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-html-light.png)
### [Color Theme] (pre-Emacs 24)
### Java (Vim)
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)` to your Emacs init file (usually `~/.emacs`).
4. Use the usual [color-theme] mechanism to select one of the Solarized themes, or `M-x color-theme-solarized-[light|dark]`.
[![java dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-java-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-java-dark.png)
[![java light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-java-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-java-light.png)
### IMPORTANT NOTE FOR TERMINAL USERS:
### Pandoc Markdown (Vim)
If you are going to use Solarized 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 used the Solarized palette. I've included palettes for some popular terminal emulator as well as Xdefaults in the official Solarized download available from [Solarized homepage]. If you use
Solarized *without* these colors, Solarized will need to be told to degrade its colorscheme to a set compatible with the limited 256 terminal palette (whereas by using the terminal's 16 ansi color values, you can set the correct, specific values for the Solarized palette).
These screen shots show Vim running with my own [Pandoc Kit
Syntax](/pandockit).
If you do use the custom terminal colors, Solarized should work out of the
box for you. If you are using a terminal emulator that supports 256 colors and
don't want to use the custom Solarized terminal colors, you will need to use
the degraded 256 colorscheme. To do so, simply customize the `solarized-degrade` variable to `t`.
[![pandoc dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-pandoc-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-pandoc-dark.png)
[![pandoc light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-pandoc-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-pandoc-light.png)
Again, I recommend just changing your terminal colors to Solarized values
either manually or via one of the many terminal schemes available for import.
### Perl (Vim)
Advanced Configuration
----------------------
[![perl dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-perl-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-perl-dark.png)
[![perl light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-perl-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-perl-light.png)
Solarized will work out of the box with just the instructions specified above but does include several other variables that can be customized.
### Python (Vim)
"
variable name default optional
-------------------------------------------
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
-------------------------------------------
[![python dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-python-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-python-dark.png)
[![python light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-python-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-python-light.png)
### Option Details
### Ruby (Vim)
* solarized-degrade
[![ruby dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-ruby-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-ruby-dark.png)
[![ruby light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-ruby-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-ruby-light.png)
For test purposes only; forces Solarized to use the 256 degraded color
mode to test the approximate color values for accuracy.
### TeX (Vim)
* solarized-bold | solarized-underline | solarized-italic
[![tex dark](https://github.com/altercation/solarized/raw/master/img/solarized-screen-tex-dark-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-tex-dark.png)
[![tex light](https://github.com/altercation/solarized/raw/master/img/solarized-screen-tex-light-th.png)](https://github.com/altercation/solarized/raw/master/img/solarized-screen-tex-light.png)
If you wish to stop Solarized from displaying bold, underlined or
italicized typefaces, simply assign a zero value to the appropriate
variable, for example: `let g:solarized_italic=0`
* solarized-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
up or down in order to expand or compress the tonal range displayed.
* solarized-visibility
Special characters such as trailing whitespace, tabs, newlines, when
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.
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.
The Values
----------