-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Do a better job of setting up the right set of colors for various configurations. - Make the theme much more compact by not making duplicate face-spec elements – e.g., only generate 256-color-specific elements if we don’t use the 16-color color names for them, and only specify the background characteristic when the face differs between dark and light. - Add functions to toggle between dark and light modes (for any theme).
- Loading branch information
Showing
3 changed files
with
123 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
;; -*- lexical-binding: t; -*- | ||
|
||
(require 'solarized-definitions | ||
(locate-file "solarized-definitions.el" custom-theme-load-path | ||
'("c" ""))) | ||
|
||
(create-solarized-theme solarized | ||
solarized-description (solarized-color-definitions)) | ||
(create-solarized-theme 'solarized | ||
solarized-description | ||
(solarized-color-definitions)) | ||
|
||
(cl-defun solarized-update-background-mode | ||
(appearance &optional (frames (frame-list))) | ||
"Set the APPEARANCE of all frames to either 'light or 'dark. | ||
This is not specific to Solarized – it will update the appearance of any theme | ||
that observes the background characteristic." | ||
(setq frame-background-mode appearance) | ||
(mapc #'frame-set-background-mode frames) | ||
;; Supposedly #'frame-set-background-mode updates the faces, but it doesn’t | ||
;; seem to actually., so re-enable all the themes. | ||
(mapc #'enable-theme (reverse custom-enabled-themes)) | ||
;; For some reason, ‘enable-theme’ (or maybe ‘solarized’?) is resetting the | ||
;; ‘frame-background-mode’, so reset it here. | ||
(setq frame-background-mode appearance)) | ||
|
||
(defun solarized-toggle-background-mode () | ||
"Toggle between light and dark background modes. | ||
This is not specific to Solarized – it will update the appearance of any theme | ||
that observes the background characteristic." | ||
(interactive) | ||
(let ((new-mode (pcase frame-background-mode | ||
('dark (message "matched") 'light) | ||
(_ (message "didn’t match") 'dark)))) | ||
(solarized-update-background-mode new-mode))) |