summaryrefslogtreecommitdiff
path: root/cider-util.el
diff options
context:
space:
mode:
authorTianxiang Xiong <tianxiang.xiong@fundingcircle.com>2018-01-09 13:29:47 -0800
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2018-01-10 15:33:08 +0200
commit76f78b81f1a7c631b37575ab592a70fbf2b1a7ed (patch)
tree3bc698bbcbffe4048007584d61cef627d7a6ab24 /cider-util.el
parent49f57751b9eba4468f1b9d3958a8f84f180d9a27 (diff)
Use `color-lighten-name` instead of custom color scaling function
Diffstat (limited to 'cider-util.el')
-rw-r--r--cider-util.el14
1 files changed, 4 insertions, 10 deletions
diff --git a/cider-util.el b/cider-util.el
index eaf7c402..d4ef8488 100644
--- a/cider-util.el
+++ b/cider-util.el
@@ -37,6 +37,7 @@
(require 'cider-compat)
(require 'nrepl-dict)
(require 'ansi-color)
+(require 'color)
(defalias 'cider-pop-back 'pop-tag-mark)
@@ -336,19 +337,12 @@ propertized (defaults to current buffer)."
;;; Colors
-(defun cider-scale-color (color scale)
- "For a COLOR hex string or name, adjust intensity of RGB components by SCALE."
- (let* ((rgb (color-values color))
- (scaled-rgb (mapcar (lambda (n)
- (format "%04x" (round (+ n (* scale 65535)))))
- rgb)))
- (apply #'concat "#" scaled-rgb)))
-
(defun cider-scale-background-color ()
"Scale the current background color to get a slighted muted version."
(let ((color (frame-parameter nil 'background-color))
- (dark (eq (frame-parameter nil 'background-mode) 'dark)))
- (cider-scale-color color (if dark 0.05 -0.05))))
+ (darkp (eq (frame-parameter nil 'background-mode) 'dark)))
+ (unless (equal "unspecified-bg" color)
+ (color-lighten-name color (if darkp 5 -5)))))
(autoload 'pkg-info-version-info "pkg-info.el")