emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/eglot-inactive-regions 3ba8e528f1 06/66: allow to change o


From: ELPA Syncer
Subject: [nongnu] elpa/eglot-inactive-regions 3ba8e528f1 06/66: allow to change opacity on the fly
Date: Fri, 6 Dec 2024 06:59:50 -0500 (EST)

branch: elpa/eglot-inactive-regions
commit 3ba8e528f1ae2ce8142d4be4b20cf44065e71664
Author: Filippo Argiolas <filippo.argiolas@gmail.com>
Commit: Filippo Argiolas <filippo.argiolas@gmail.com>

    allow to change opacity on the fly
---
 eglot-clangd-inactive-regions.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/eglot-clangd-inactive-regions.el b/eglot-clangd-inactive-regions.el
index 1160034dbc..15aaa4f448 100644
--- a/eglot-clangd-inactive-regions.el
+++ b/eglot-clangd-inactive-regions.el
@@ -47,7 +47,8 @@ dim.")
 (defun ecir--color-blend (from-color to-color alpha)
   "Linearly interpolate between two colors."
   (let ((from-rgb (color-name-to-rgb from-color))
-        (to-rgb (color-name-to-rgb to-color)))
+        (to-rgb (color-name-to-rgb to-color))
+        (alpha (min 1.0 (max 0.0 alpha))))
     (apply 'format
            "#%02x%02x%02x"
            (cl-mapcar #'(lambda (a b)
@@ -104,6 +105,12 @@ face or theme change."
             (end (cdr range)))
         (ecir--darken-region beg end eglot-clangd-inactive-regions-opacity)))))
 
+(defun eglot-clangd-inactive-regions-change-opacity (opacity)
+  "Interactively set a new opacity value for inactive regions."
+  (interactive "nNew inactive region opacity: ")
+   (setq eglot-clangd-inactive-regions-opacity opacity)
+   (eglot-clangd-inactive-regions-refresh))
+
 (defun eglot-clangd-inactive-regions-cleanup ()
   "Clean up inactive regions."
   (mapc #'delete-overlay eglot-clangd-inactive-regions-overlays)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]