From e2de625803c6360c99af7d787f036a51a07738b0 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 9 May 2019 14:33:50 +0900 Subject: [PATCH] Update my-gen-hl-line-color-dark () to reject grey color --- emacs.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/emacs.el b/emacs.el index 7e59a76..f5f3dcb 100644 --- a/emacs.el +++ b/emacs.el @@ -783,12 +783,19 @@ found, otherwise returns nil." (defun my-gen-hl-line-color-dark () "Generate color for current line in black background." - (let* ((candidates (mapcar 'number-to-string (number-sequence 0 6))) - (limit (length candidates))) + (let* ((candidates (mapcar 'number-to-string (number-sequence 1 6))) + (limit (length candidates)) + (r 0) (g 0) (b 0)) + (while (and (<= (abs (- r g)) 1) + (<= (abs (- g b)) 1) + (<= (abs (- b r)) 1)) + (setq r (random limit)) + (setq g (random limit)) + (setq b (random limit))) (format "#%s%s%s" - (nth (random limit) candidates) - (nth (random limit) candidates) - (nth (random limit) candidates) + (nth r candidates) + (nth g candidates) + (nth b candidates) ))) ;; (my-gen-hl-line-color-dark)