[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d82dc2c 328/348: counsel.el (counsel-colors--best-contrast
From: |
Oleh Krehel |
Subject: |
[elpa] master d82dc2c 328/348: counsel.el (counsel-colors--best-contrast-color): Return same color on error |
Date: |
Sat, 8 Apr 2017 11:04:24 -0400 (EDT) |
branch: master
commit d82dc2c0d33f1cd4b74876af8f920c81a3636f4b
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-colors--best-contrast-color): Return same color on error
In case `color-name-to-rgb' returns nil.
Re #921
---
counsel.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/counsel.el b/counsel.el
index a2d3945..7ec3a7b 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2809,13 +2809,15 @@ midpoint, then the chosen color is black, otherwise is
white. This
helps to improve the contrast and readability of a text regardless of
the background color."
(let ((rgb (color-name-to-rgb color)))
- (if (>
- (+ (* (nth 0 rgb) 0.299)
- (* (nth 1 rgb) 0.587)
- (* (nth 2 rgb) 0.114))
- 0.5)
- "#000000"
- "#FFFFFF")))
+ (if rgb
+ (if (>
+ (+ (* (nth 0 rgb) 0.299)
+ (* (nth 1 rgb) 0.587)
+ (* (nth 2 rgb) 0.114))
+ 0.5)
+ "#000000"
+ "#FFFFFF")
+ color)))
(defun counsel-colors--update-highlight (cand)
"Update the highlight face for the current candidate CAND.
- [elpa] master 7dea0ff 255/348: Use ivy-format-function approach for counsel-faces, (continued)
- [elpa] master 7dea0ff 255/348: Use ivy-format-function approach for counsel-faces, Oleh Krehel, 2017/04/08
- [elpa] master 2989f25 268/348: swiper.el (swiper--update-input-ivy): Fix window-end call, Oleh Krehel, 2017/04/08
- [elpa] master c2c0e2d 270/348: ivy.el: Simplify previous commit, Oleh Krehel, 2017/04/08
- [elpa] master 75f9ceb 286/348: Allow spaces in file names when running linux apps., Oleh Krehel, 2017/04/08
- [elpa] master 2f70c56 287/348: Revert "Add missing parameter for ag", Oleh Krehel, 2017/04/08
- [elpa] master 950545b 304/348: counsel.el (counsel-linux-apps-list): Check if dir exists, Oleh Krehel, 2017/04/08
- [elpa] master 65979f6 291/348: Heed non-sort entries in ivy-sort-functions-alist, Oleh Krehel, 2017/04/08
- [elpa] master ce3c0ec 317/348: ivy.el (ivy-completing-read): Adjust :caller, Oleh Krehel, 2017/04/08
- [elpa] master d9d7592 315/348: ivy.el (ivy-completion-in-region): Remove :require-match, Oleh Krehel, 2017/04/08
- [elpa] master 4d72dc1 327/348: ivy.el: Change recursive restore order, Oleh Krehel, 2017/04/08
- [elpa] master d82dc2c 328/348: counsel.el (counsel-colors--best-contrast-color): Return same color on error,
Oleh Krehel <=
- [elpa] master 3fbeaa5 333/348: Define ivy-help-file with defconst, Oleh Krehel, 2017/04/08
- [elpa] master fee9810 336/348: ivy.el (ivy-partial): Fix for :dynamic-collection, Oleh Krehel, 2017/04/08
- [elpa] master 5f04a70 322/348: ivy.el: Move ivy-recursive-last logic to ivy-call, Oleh Krehel, 2017/04/08
- [elpa] master ff3b696 338/348: counsel.el (counsel-find-file): Add new action counsel-find-file-as-root, Oleh Krehel, 2017/04/08
- [elpa] master 8c9f6a3 340/348: swiper.el: Silence byte-compiler, Oleh Krehel, 2017/04/08
- [elpa] master a63a935 339/348: counsel.el (counsel--find-symbol): Fix typo, Oleh Krehel, 2017/04/08
- [elpa] master cba6888 344/348: Bump version to 0.9.0, Oleh Krehel, 2017/04/08
- [elpa] master 83b00ff 346/348: doc/Changelog.org: Fix links, Oleh Krehel, 2017/04/08