diff options
| -rw-r--r-- | README.org | 41 | ||||
| -rw-r--r-- | ef-autumn-theme.el | 3 | ||||
| -rw-r--r-- | ef-bio-theme.el | 3 | ||||
| -rw-r--r-- | ef-cherie-theme.el | 3 | ||||
| -rw-r--r-- | ef-cyprus-theme.el | 3 | ||||
| -rw-r--r-- | ef-dark-theme.el | 3 | ||||
| -rw-r--r-- | ef-day-theme.el | 3 | ||||
| -rw-r--r-- | ef-deuteranopia-dark-theme.el | 3 | ||||
| -rw-r--r-- | ef-deuteranopia-light-theme.el | 3 | ||||
| -rw-r--r-- | ef-duo-dark-theme.el | 3 | ||||
| -rw-r--r-- | ef-duo-light-theme.el | 3 | ||||
| -rw-r--r-- | ef-frost-theme.el | 3 | ||||
| -rw-r--r-- | ef-light-theme.el | 3 | ||||
| -rw-r--r-- | ef-night-theme.el | 3 | ||||
| -rw-r--r-- | ef-spring-theme.el | 3 | ||||
| -rw-r--r-- | ef-summer-theme.el | 3 | ||||
| -rw-r--r-- | ef-themes.el | 80 | ||||
| -rw-r--r-- | ef-trio-dark-theme.el | 3 | ||||
| -rw-r--r-- | ef-trio-light-theme.el | 3 | ||||
| -rw-r--r-- | ef-tritanopia-dark-theme.el | 3 | ||||
| -rw-r--r-- | ef-tritanopia-light-theme.el | 3 | ||||
| -rw-r--r-- | ef-winter-theme.el | 3 |
22 files changed, 180 insertions, 1 deletions
@@ -368,6 +368,47 @@ will retain the original aesthetic for that level. For example: (t . t))) ; default style for all other levels #+end_src +** Style of region highlight +:PROPERTIES: +:CUSTOM_ID: h:1d5fa3d8-a769-455a-aac7-5c1b925bb10b +:END: + +[ This user option is part of {{{development-version}}}. ] + +#+vindex: ef-themes-region +The user option ~ef-themes-region~ controls the appearance of the +~region~ face (the highlighted selection of an area). + +The value it accepts is a list of symbols. + +If ~nil~ or an empty list (the default), use a subtle background for +the region and preserve the color of selected text. + +The ~no-extend~ symbol limits the highlighted area to the end of the +line, so that it does not reach the edge of the window. + +The ~neutral~ symbol makes the highlighted area's background gray (or +more gray, depending on the theme). + +The ~intense~ symbol amplifies the intensity of the highlighted area's +background color. It also overrides any text color to keep it +legible. + +Combinations of those symbols are expressed in any order. + +In user configuration files the form may look like this: + +#+begin_src emacs-lisp +(setq modus-themes-region '(intense no-extend)) +#+end_src + +Other examples: + +#+begin_src emacs-lisp +(setq modus-themes-region '(intense)) +(setq modus-themes-region '(intense no-extend neutral)) +#+end_src + * Loading a theme :PROPERTIES: :CUSTOM_ID: h:75d74aea-d17f-497f-a3b8-f0bf4c372de0 diff --git a/ef-autumn-theme.el b/ef-autumn-theme.el index bd1ac9f..8c8b88a 100644 --- a/ef-autumn-theme.el +++ b/ef-autumn-theme.el @@ -144,6 +144,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#4f4400") + ;; Mappings (err red-warmer) (warning yellow) diff --git a/ef-bio-theme.el b/ef-bio-theme.el index d79de33..e172d1d 100644 --- a/ef-bio-theme.el +++ b/ef-bio-theme.el @@ -144,6 +144,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#0f5450") + ;; Mappings (err red) (warning yellow-cooler) diff --git a/ef-cherie-theme.el b/ef-cherie-theme.el index 088dc1e..dcc3198 100644 --- a/ef-cherie-theme.el +++ b/ef-cherie-theme.el @@ -144,6 +144,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#3f3460") + ;; Mappings (err red-warmer) (warning yellow-warmer) diff --git a/ef-cyprus-theme.el b/ef-cyprus-theme.el index b10da96..83d9aaa 100644 --- a/ef-cyprus-theme.el +++ b/ef-cyprus-theme.el @@ -144,6 +144,9 @@ (underline-warning "#bf5f00") (underline-info "#02af5f") + ;; Conditional hues + (bg-region-intense "#dcd09f") + ;; Mappings (err red-warmer) (warning yellow) diff --git a/ef-dark-theme.el b/ef-dark-theme.el index 13ba89c..0775bc1 100644 --- a/ef-dark-theme.el +++ b/ef-dark-theme.el @@ -144,6 +144,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#3a3465") + ;; Mappings (err red-warmer) (warning yellow) diff --git a/ef-day-theme.el b/ef-day-theme.el index cf69ece..50f8d0f 100644 --- a/ef-day-theme.el +++ b/ef-day-theme.el @@ -144,6 +144,9 @@ (underline-warning "#bf5f00") (underline-info "#02af52") + ;; Conditional hues + (bg-region-intense "#dfc39a") + ;; Mappings (err red-warmer) (warning yellow) diff --git a/ef-deuteranopia-dark-theme.el b/ef-deuteranopia-dark-theme.el index 0f8402a..1695b95 100644 --- a/ef-deuteranopia-dark-theme.el +++ b/ef-deuteranopia-dark-theme.el @@ -147,6 +147,9 @@ (underline-warning "#bfaf50") (underline-info "#22cff2") + ;; Conditional hues + (bg-region-intense "#1f1f70") + ;; Mappings (err yellow-warmer) (warning yellow) diff --git a/ef-deuteranopia-light-theme.el b/ef-deuteranopia-light-theme.el index 8da64e6..a0c944f 100644 --- a/ef-deuteranopia-light-theme.el +++ b/ef-deuteranopia-light-theme.el @@ -147,6 +147,9 @@ (underline-warning "#6f3f00") (underline-info "#025f92") + ;; Conditional hues + (bg-region-intense "#cfcf9a") + ;; Mappings (err yellow-warmer) (warning yellow) diff --git a/ef-duo-dark-theme.el b/ef-duo-dark-theme.el index 15507e6..1ef3f80 100644 --- a/ef-duo-dark-theme.el +++ b/ef-duo-dark-theme.el @@ -147,6 +147,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#1f2f70") + ;; Mappings (err red) (warning yellow) diff --git a/ef-duo-light-theme.el b/ef-duo-light-theme.el index 857466c..7412c42 100644 --- a/ef-duo-light-theme.el +++ b/ef-duo-light-theme.el @@ -148,6 +148,9 @@ (underline-warning "#bf5f00") (underline-info "#02af52") + ;; Conditional hues + (bg-region-intense "#dfc2b0") + ;; Mappings (err red) (warning yellow) diff --git a/ef-frost-theme.el b/ef-frost-theme.el index f2bb3ce..b7d9fc3 100644 --- a/ef-frost-theme.el +++ b/ef-frost-theme.el @@ -144,6 +144,9 @@ (underline-warning "#bf5f00") (underline-info "#02af52") + ;; Conditional hues + (bg-region-intense "#aadfcc") + ;; Mappings (err red) (warning yellow-cooler) diff --git a/ef-light-theme.el b/ef-light-theme.el index 117b735..adf7335 100644 --- a/ef-light-theme.el +++ b/ef-light-theme.el @@ -144,6 +144,9 @@ (underline-warning "#bf5f00") (underline-info "#02af52") + ;; Conditional hues + (bg-region-intense "#afdfc0") + ;; Mappings (err red-warmer) (warning yellow-warmer) diff --git a/ef-night-theme.el b/ef-night-theme.el index dcbfec1..285543b 100644 --- a/ef-night-theme.el +++ b/ef-night-theme.el @@ -144,6 +144,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#3f2f60") + ;; Mappings (err red) (warning yellow-warmer) diff --git a/ef-spring-theme.el b/ef-spring-theme.el index 755b831..521d88c 100644 --- a/ef-spring-theme.el +++ b/ef-spring-theme.el @@ -144,6 +144,9 @@ (underline-warning "#bf5f00") (underline-info "#02af52") + ;; Conditional hues + (bg-region-intense "#dfb0d0") + ;; Mappings (err red-warmer) (warning yellow) diff --git a/ef-summer-theme.el b/ef-summer-theme.el index d4106df..5a5f6d5 100644 --- a/ef-summer-theme.el +++ b/ef-summer-theme.el @@ -144,6 +144,9 @@ (underline-warning "#bf5f00") (underline-info "#02af52") + ;; Conditional hues + (bg-region-intense "#caaadf") + ;; Mappings (err red-warmer) (warning yellow) diff --git a/ef-themes.el b/ef-themes.el index f38beae..c6e5ac1 100644 --- a/ef-themes.el +++ b/ef-themes.el @@ -256,8 +256,59 @@ ELPA (by Protesilaos))." :type 'boolean :link '(info-link "(ef-themes) UI typeface")) +(defcustom ef-themes-region nil + "Control the appearance of the `region' face. + +The value is a list of symbols. + +If nil or an empty list (the default), use a subtle background +for the region and preserve the color of selected text. + +The `no-extend' symbol limits the highlighted area to the end of +the line, so that it does not reach the edge of the window. + +The `neutral' symbol makes the highlighted area's background +gray (or more gray, depending on the theme). + +The `intense' symbol amplifies the intensity of the highlighted +area's background color. It also overrides any text color to +keep it legible. + +Combinations of those symbols are expressed in any order. + +In user configuration files the form may look like this: + + (setq modus-themes-region \\='(intense no-extend)) + +Other examples: + + (setq modus-themes-region \\='(intense)) + (setq modus-themes-region \\='(intense no-extend neutral))" + :group 'ef-themes + :package-version '(ef-themes . "0.10.0") + :type '(set :tag "Properties" :greedy t + (const :tag "Do not extend to the edge of the window" no-extend) + (const :tag "More neutral/gray background" neutral) + (const :tag "More intense background (also override text color)" accented)) + :link '(info-link "(ef-themes) Style of region highlight")) + ;;; Helpers for user options +(defun ef-themes--warn (option) + "Warn that OPTION has changed." + (prog1 nil + (display-warning + 'ef-themes + (format "`%s' has changed; please read the updated documentation" option) + :warning))) + +(defun ef-themes--list-or-warn (option) + "Return list or nil value of OPTION, else `ef-themes--warn'." + (let* ((value (symbol-value option))) + (if (or (null value) (listp value)) + value + (ef-themes--warn option)))) + (defun ef-themes--fixed-pitch () "Conditional application of `fixed-pitch' inheritance." (when ef-themes-mixed-fonts @@ -310,6 +361,33 @@ sequence given SEQ-PRED, using SEQ-DEFAULT as a fallback." :weight (or weight 'unspecified)))) +(defun ef-themes--region (bg bgneutral bgintense bgintenseneutral fgintense) + "Apply `ef-themes-region' styles. + +BG is the default background. BGNEUTRAL is its gray counterpart. +BGINTENSE is an amplified variant of BG, while BGINTENSENEUTRAL +is a more intense neutral background. FGINTENSE is the +foreground that is used with any of the intense backgrounds." + (let ((properties (ef-themes--list-or-warn 'ef-themes-region))) + (list + :background + (cond + ((and (memq 'intense properties) (memq 'neutral properties)) + bgintenseneutral) + ((memq 'intense properties) + bgintense) + ((memq 'neutral properties) + bgneutral) + (bg)) + :foreground + (if (memq 'intense properties) + fgintense + 'unspecified) + :extend + (if (memq 'no-extend properties) + nil + t)))) + ;;; Commands and their helper functions (defun ef-themes--list-enabled-themes () @@ -608,7 +686,7 @@ Helper function for `ef-themes-preview-colors'." `(cursor ((,c :background ,cursor))) `(default ((,c :background ,bg-main :foreground ,fg-main))) `(italic ((,c :slant italic))) - `(region ((,c :background ,bg-region))) + `(region ((,c ,@(ef-themes--region bg-region bg-alt bg-region-intense bg-active fg-intense)))) `(vertical-border ((,c :foreground ,border))) ;;;;; all other basic faces `(button ((,c :foreground ,link :underline ,border))) diff --git a/ef-trio-dark-theme.el b/ef-trio-dark-theme.el index 8130121..ae0b9e6 100644 --- a/ef-trio-dark-theme.el +++ b/ef-trio-dark-theme.el @@ -144,6 +144,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#5d336c") + ;; Mappings (err red-warmer) (warning yellow) diff --git a/ef-trio-light-theme.el b/ef-trio-light-theme.el index 85c65dc..3e8e811 100644 --- a/ef-trio-light-theme.el +++ b/ef-trio-light-theme.el @@ -144,6 +144,9 @@ (underline-warning "#bf5f00") (underline-info "#02af52") + ;; Conditional hues + (bg-region-intense "#aacacf") + ;; Mappings (err red-warmer) (warning yellow-warmer) diff --git a/ef-tritanopia-dark-theme.el b/ef-tritanopia-dark-theme.el index c591f7c..7116cd9 100644 --- a/ef-tritanopia-dark-theme.el +++ b/ef-tritanopia-dark-theme.el @@ -147,6 +147,9 @@ (underline-warning "#ffafa0") (underline-info "#22ffd2") + ;; Conditional hues + (bg-region-intense "#5f303f") + ;; Mappings (err red-warmer) (warning magenta) diff --git a/ef-tritanopia-light-theme.el b/ef-tritanopia-light-theme.el index 70e0ed8..a950840 100644 --- a/ef-tritanopia-light-theme.el +++ b/ef-tritanopia-light-theme.el @@ -147,6 +147,9 @@ (underline-warning "#af7f90") (underline-info "#22afc2") + ;; Conditional hues + (bg-region-intense "#dfa5a5") + ;; Mappings (err red-warmer) (warning magenta) diff --git a/ef-winter-theme.el b/ef-winter-theme.el index a603411..5ef582b 100644 --- a/ef-winter-theme.el +++ b/ef-winter-theme.el @@ -144,6 +144,9 @@ (underline-warning "#c0b000") (underline-info "#22b022") + ;; Conditional hues + (bg-region-intense "#4f2f5d") + ;; Mappings (err red-warmer) (warning yellow) |
