Add `solarized-broken-srgb` custom variable.

This allows real sRGB colors where it's supported and Gen RGB where it's not. Fixes issue #19.

Adapted from a patch by @hdhoang.
This commit is contained in:
Greg Pfeil 2012-02-12 09:26:13 -07:00
parent 607de3b0c7
commit 0127faafbe
2 changed files with 28 additions and 11 deletions

View File

@ -74,16 +74,17 @@ Advanced Configuration
Solarized 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
-------------------------------------------
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)
--------------------------------------------
### Option Details
@ -121,6 +122,14 @@ but does include several variables that can be customized.
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.
* solarized-broken-srgb
Emacs [bug #8402](http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8402)
results in incorrect color handling on Macs. If this is `t` (the default
on Macs), Solarized 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.
Code Notes
----------

View File

@ -44,6 +44,14 @@ in order to expand or compress the tonal range displayed."
:options '(high normal low)
:group 'solarized)
(defcustom solarized-broken-srgb (if (eq system-type 'darwin) t 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.
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."
:type 'boolean
:group 'solarized)
;; 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
@ -74,7 +82,7 @@ in order to expand or compress the tonal range displayed."
(let ((index (if window-system
(if solarized-degrade
3
2)
(if solarized-broken-srgb 2 1))
(if (= solarized-termcolors 256)
3
4))))