mirror of
https://github.com/sellout/emacs-color-theme-solarized.git
synced 2024-06-29 08:00:56 +02:00
Added support for solarized-termcolors as docs state
This commit is contained in:
parent
ec7dc87285
commit
c570d202a2
|
@ -51,6 +51,13 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'solarized)
|
:group 'solarized)
|
||||||
|
|
||||||
|
(defcustom solarized-termcolors 16
|
||||||
|
"Number of colors to assume if in terminal mode. If nil, then
|
||||||
|
try to figure out from display-color-cells. Useful when wanting
|
||||||
|
to using modified color maps but running in 256 color mode."
|
||||||
|
:type 'integer
|
||||||
|
:group 'solarized)
|
||||||
|
|
||||||
;; FIXME: The Generic RGB colors will actually vary from device to device, but
|
;; 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
|
;; hopefully these are closer to the intended colors than the sRGB values
|
||||||
;; that Emacs seems to dislike
|
;; that Emacs seems to dislike
|
||||||
|
@ -77,12 +84,15 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
|
||||||
capabilities, etc.")
|
capabilities, etc.")
|
||||||
|
|
||||||
(defun solarized-color-definitions (mode)
|
(defun solarized-color-definitions (mode)
|
||||||
(flet ((find-color (name)
|
(flet ((effective-color-cells () (if solarized-termcolors
|
||||||
|
solarized-termcolors
|
||||||
|
(display-color-cells)))
|
||||||
|
(find-color (name)
|
||||||
(let* ((index (if window-system
|
(let* ((index (if window-system
|
||||||
(if solarized-degrade
|
(if solarized-degrade
|
||||||
3
|
3
|
||||||
(if solarized-broken-srgb 2 1))
|
(if solarized-broken-srgb 2 1))
|
||||||
(case (display-color-cells)
|
(case (effective-color-cells)
|
||||||
(16 4)
|
(16 4)
|
||||||
(8 5)
|
(8 5)
|
||||||
(otherwise 3)))))
|
(otherwise 3)))))
|
||||||
|
@ -114,7 +124,7 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
|
||||||
(rotatef base01 base1)
|
(rotatef base01 base1)
|
||||||
(rotatef base00 base0))
|
(rotatef base00 base0))
|
||||||
(let ((back base03))
|
(let ((back base03))
|
||||||
(cond ((< (display-color-cells) 16)
|
(cond ((< (effective-color-cells) 16)
|
||||||
(setf back nil))
|
(setf back nil))
|
||||||
((eq 'high solarized-contrast)
|
((eq 'high solarized-contrast)
|
||||||
(let ((orig-base3 base3))
|
(let ((orig-base3 base3))
|
||||||
|
@ -148,9 +158,9 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
|
||||||
(fg-base02 `(:foreground ,base02))
|
(fg-base02 `(:foreground ,base02))
|
||||||
(fg-base01 `(:foreground ,base01))
|
(fg-base01 `(:foreground ,base01))
|
||||||
(fg-base00 `(:foreground ,base00))
|
(fg-base00 `(:foreground ,base00))
|
||||||
(fg-base0 `(:foreground ,(when (<= 16 (display-color-cells))
|
(fg-base0 `(:foreground ,(when (<= 16 (effective-color-cells))
|
||||||
base0)))
|
base0)))
|
||||||
(fg-base1 `(:foreground ,(when (<= 16 (display-color-cells))
|
(fg-base1 `(:foreground ,(when (<= 16 (effective-color-cells))
|
||||||
base1)))
|
base1)))
|
||||||
(fg-base2 `(:foreground ,base2))
|
(fg-base2 `(:foreground ,base2))
|
||||||
(fg-base3 `(:foreground ,base3))
|
(fg-base3 `(:foreground ,base3))
|
||||||
|
@ -194,6 +204,7 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
|
||||||
(lazy-highlight ((t (,@fmt-revr ,@fg-yellow ,@bg-back)))) ; Search
|
(lazy-highlight ((t (,@fmt-revr ,@fg-yellow ,@bg-back)))) ; Search
|
||||||
(link ((t (,@fmt-undr ,@fg-violet))))
|
(link ((t (,@fmt-undr ,@fg-violet))))
|
||||||
(link-visited ((t (,@fmt-undr ,@fg-magenta))))
|
(link-visited ((t (,@fmt-undr ,@fg-magenta))))
|
||||||
|
(match ((t (,@fmt-stnd ,@fg-orange ,@bg-back))))
|
||||||
(menu ((t (,@fg-base0 ,@bg-base02))))
|
(menu ((t (,@fg-base0 ,@bg-base02))))
|
||||||
(minibuffer-prompt ((t (,@fmt-bold ,@fg-cyan)))) ; Question
|
(minibuffer-prompt ((t (,@fmt-bold ,@fg-cyan)))) ; Question
|
||||||
(mode-line ; StatusLine
|
(mode-line ; StatusLine
|
||||||
|
@ -532,10 +543,10 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further."
|
||||||
(term-color-cyan ((t ( ,@fg-cyan))))
|
(term-color-cyan ((t ( ,@fg-cyan))))
|
||||||
(term-color-white ((t ( ,@fg-base00)))))
|
(term-color-white ((t ( ,@fg-base00)))))
|
||||||
|
|
||||||
((foreground-color . ,(when (<= 16 (display-color-cells)) base0))
|
((foreground-color . ,(when (<= 16 (effective-color-cells)) base0))
|
||||||
(background-color . ,back)
|
(background-color . ,back)
|
||||||
(background-mode . ,mode)
|
(background-mode . ,mode)
|
||||||
(cursor-color . ,(when (<= 16 (display-color-cells))
|
(cursor-color . ,(when (<= 16 (effective-color-cells))
|
||||||
base0))
|
base0))
|
||||||
(ansi-color-names-vector . [,base02 ,red ,green ,yellow ,blue ,magenta ,cyan ,base00]))))))))
|
(ansi-color-names-vector . [,base02 ,red ,green ,yellow ,blue ,magenta ,cyan ,base00]))))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user