Fix some bugs

We were building faces wrong, but somehow they still worked, also had some
incorrect things elsewhere.
This commit is contained in:
Greg Pfeil 2023-01-31 17:58:04 -07:00
parent 6537daf7d0
commit 30dbe0010c
No known key found for this signature in database
GPG Key ID: 1193ACD196ED61F2
1 changed files with 33 additions and 29 deletions

View File

@ -112,10 +112,8 @@ LIGHT is non-nil."
(and (eq property :foreground) (and (eq property :foreground)
(member color-name '(base0 base1))))) (member color-name '(base0 base1)))))
(setf color-name nil)) (setf color-name nil))
(when (eq color-name 'back)
(setf color-name 'base03))
(when light (when light
(setf color-name (setq color-name
(cl-case color-name (cl-case color-name
(base03 'base3) (base03 'base3)
(base02 'base2) (base02 'base2)
@ -125,7 +123,20 @@ LIGHT is non-nil."
(base1 'base01) (base1 'base01)
(base2 'base02) (base2 'base02)
(base3 'base03) (base3 'base03)
(back 'base03)
(otherwise color-name)))) (otherwise color-name))))
(cond ((eq 'high solarized-contrast)
(setq color-name
(cl-case color-name
(base01 'base00)
(base00 'base0)
(base0 'base1)
(base1 'base2)
(base2 'base3)
; (back 'back)
(otherwise color-name))))
((eq 'low solarized-contrast)
(if (eq color-name 'back) (setq color-name 'base02))))
(plist-put new-fontspec (plist-put new-fontspec
property property
(nth index (assoc color-name solarized-colors)))))) (nth index (assoc color-name solarized-colors))))))
@ -141,46 +152,39 @@ LIGHT is non-nil."
This generates the spec across a variety of displays from the FACESPEC, which This generates the spec across a variety of displays from the FACESPEC, which
contains Solarized symbols." contains Solarized symbols."
`(,name ((((background dark) (type graphic)) `(,name ((((background dark) (type graphic))
,(solarized-face-for-index facespec ,@(solarized-face-for-index facespec
(cond (solarized-degrade 3) (cond (solarized-degrade 3)
(solarized-broken-srgb 2) (solarized-broken-srgb 2)
(t 1)))) (t 1))))
(((background dark) (type tty) (min-colors 256)) (((background dark) (type tty) (min-colors 256))
,(solarized-face-for-index facespec ,@(solarized-face-for-index facespec
(if (= solarized-termcolors 16) 4 3))) (if (= solarized-termcolors 16) 4 3)))
(((background dark) (type tty) (min-colors 16)) (((background dark) (type tty) (min-colors 16))
,(solarized-face-for-index facespec 4)) ,@(solarized-face-for-index facespec 4))
(((background dark) (type tty) (min-colors 8)) (((background dark) (type tty) (min-colors 8))
,(solarized-face-for-index facespec 5)) ,@(solarized-face-for-index facespec 5))
(((background light) (type graphic)) (((background light) (type graphic))
,(solarized-face-for-index facespec ,@(solarized-face-for-index facespec
(cond (solarized-degrade 3) (cond (solarized-degrade 3)
(solarized-broken-srgb 2) (solarized-broken-srgb 2)
(t 1)) (t 1))
t)) t))
(((background light) (type tty) (min-colors 256)) (((background light) (type tty) (min-colors 256))
,(solarized-face-for-index facespec ,@(solarized-face-for-index facespec
(if (= solarized-termcolors 16) 4 3) (if (= solarized-termcolors 16) 4 3)
t)) t))
(((background light) (type tty) (min-colors 16)) (((background light) (type tty) (min-colors 16))
,(solarized-face-for-index facespec 4 t)) ,@(solarized-face-for-index facespec 4 t))
(((background light) (type tty) (min-colors 8)) (((background light) (type tty) (min-colors 8))
,(solarized-face-for-index facespec 5 t))))) ,@(solarized-face-for-index facespec 5 t)))))
(defun solarized-color-definitions () (defun solarized-color-definitions ()
"Produces the set of face-specs for all faces defined by this theme." "Produces the set of face-specs for all faces defined by this theme."
(let ((bold (if solarized-bold 'bold 'unspecified)) (let ((bold (if solarized-bold 'bold 'unspecified))
(bright-bold (if solarized-bold 'unspecified 'bold)) (bright-bold (if solarized-bold 'unspecified 'bold))
(underline (if solarized-underline t 'unspecified)) (underline (if solarized-underline t 'unspecified))
(opt-under 'unspecified) (opt-under (if (eq solarized-contrast 'low) t 'unspecified))
(italic (if solarized-italic 'italic 'unspecified))) (italic (if solarized-italic 'italic 'unspecified)))
(cond ((eq 'high solarized-contrast)
(let ((orig-base3 base3))
(rotatef base01 base00 base0 base1 base2 base3)
(setf base3 orig-base3)))
((eq 'low solarized-contrast)
(setf back base02
opt-under t)))
(let ((bg-back '(:background back)) (let ((bg-back '(:background back))
(bg-base03 '(:background base03)) (bg-base03 '(:background base03))
(bg-base02 '(:background base02)) (bg-base02 '(:background base02))