Bring back the modus-themes-adjust-value

Derivative themes may need it.
This commit is contained in:
Protesilaos Stavrou 2026-03-08 21:43:54 +02:00
parent cb20bbe83f
commit ed36e34132
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -3784,6 +3784,14 @@ HEX-COLOR-1 and HEX-COLOR-2 are color values written in hexadecimal RGB."
(+ (modus-themes-wcag-formula hex-color-2) 0.05))))
(max ct (/ ct))))
(defun modus-themes-adjust-value (hex-rgb percentage)
"Adjust value of HEX-RGB colour by PERCENTAGE."
(pcase-let* ((`(,r ,g ,b) (color-name-to-rgb hex-rgb))
(fn (if (color-dark-p (list r g b))
#'color-lighten-name
#'color-darken-name)))
(funcall fn hex-rgb percentage)))
(defvar modus-themes-registered-items nil
"List of defined themes.
This list is instantiated by the `modus-themes-theme' macro. Themes