GNU bug report logs - #17808
24.4.50; vc-annotate colors

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Thu, 19 Jun 2014 07:12:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 24.4.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juri Linkov <juri <at> jurta.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#17808: closed (24.4.50; vc-annotate colors)
Date: Tue, 08 Jul 2014 08:53:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 08 Jul 2014 11:51:43 +0300
with message-id <8761j844io.fsf <at> mail.jurta.org>
and subject line Re: bug#17808: 24.4.50; vc-annotate colors
has caused the debbugs.gnu.org bug report #17808,
regarding 24.4.50; vc-annotate colors
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
17808: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17808
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50; vc-annotate colors
Date: Thu, 19 Jun 2014 09:54:44 +0300
Severity: wishlist
Tags: patch

Currently vc-annotate uses dark background even when the default background
is light.  Would be nicer to have another option similar to the existing
`vc-annotate-background' that will define the default foreground
(instead of the default background) and put colors from color-map
on the background instead of the foreground:

=== modified file 'lisp/vc/vc-annotate.el'
--- lisp/vc/vc-annotate.el	2014-02-10 01:34:22 +0000
+++ lisp/vc/vc-annotate.el	2014-06-19 06:52:59 +0000
@@ -109,6 +109,16 @@ (defcustom vc-annotate-background "black
   :type '(choice (const :tag "Default background" nil) (color))
   :group 'vc)
 
+(defcustom vc-annotate-foreground nil
+  "Foreground color for \\[vc-annotate].
+When non-nil, the color range from `vc-annotate-color-map'
+is applied to background, and the color from this definition
+is applied to foreground.
+This option is in effect only when `vc-annotate-background' is nil."
+  :type '(choice (const :tag "Default foreground" nil) (color))
+  :version "24.5"
+  :group 'vc)
+
 (defcustom vc-annotate-menu-elements '(2 0.5 0.1 0.01)
   "Menu elements for the mode-specific menu of VC-Annotate mode.
 List of factors, used to expand/compress the time scale.  See `vc-annotate'."
@@ -347,7 +357,9 @@ (defun vc-annotate (file rev &optional d
 `vc-annotate-menu-elements' customizes the menu elements of the
 mode-specific menu.  `vc-annotate-color-map' and
 `vc-annotate-very-old-color' define the mapping of time to colors.
-`vc-annotate-background' specifies the background color."
+`vc-annotate-background' specifies the background color.
+`vc-annotate-foreground' specifies the foreground color
+when `vc-annotate-background' is nil."
   (interactive
    (save-current-buffer
      (vc-ensure-vc-buffer)
@@ -666,10 +678,15 @@ (defun vc-annotate-lines (limit)
                ;; Make the face if not done.
                (face (or (intern-soft face-name)
                          (let ((tmp-face (make-face (intern face-name))))
-                           (set-face-foreground tmp-face (cdr color))
-                           (when vc-annotate-background
-			     (set-face-background tmp-face
-						  vc-annotate-background))
+                           (cond
+                            (vc-annotate-background
+                             (set-face-foreground tmp-face (cdr color))
+                             (set-face-background tmp-face vc-annotate-background))
+                            (vc-annotate-foreground
+                             (set-face-foreground tmp-face vc-annotate-foreground)
+                             (set-face-background tmp-face (cdr color)))
+                            (t
+                             (set-face-foreground tmp-face (cdr color))))
                            tmp-face))))	; Return the face
           (put-text-property start end 'face face)))))
   ;; Pretend to font-lock there were no matches.



[Message part 3 (message/rfc822, inline)]
From: Juri Linkov <juri <at> jurta.org>
To: 17808-done <at> debbugs.gnu.org
Subject: Re: bug#17808: 24.4.50; vc-annotate colors
Date: Tue, 08 Jul 2014 11:51:43 +0300
Version: 24.4.50

> To reduce saturation from 75% to 20% it was helpful to use
> the function `color-hsv-to-rgb' that I found in the list archives.

Installed in the trunk.

PS: this code shows how `color-hsv-to-rgb' could be used
to reduce saturation:

(pp
 (mapcar
  (lambda (pair)
    (cons
     (car pair)
     (let ((hsv (apply 'color-rgb-to-hsv
                       (color-name-to-rgb
                        (cdr pair)))))
       (apply 'color-rgb-to-hex
              (color-hsv-to-rgb
               (nth 0 hsv) 0.20 (nth 2 hsv))))))
  '(( 20. . "#FF3F3F")
    ( 40. . "#FF6C3F")
    ( 60. . "#FF993F")
    ( 80. . "#FFC63F")
    (100. . "#FFF33F")
    (120. . "#DDFF3F")
    (140. . "#B0FF3F")
    (160. . "#83FF3F")
    (180. . "#56FF3F")
    (200. . "#3FFF56")
    (220. . "#3FFF83")
    (240. . "#3FFFB0")
    (260. . "#3FFFDD")
    (280. . "#3FF3FF")
    (300. . "#3FC6FF")
    (320. . "#3F99FF")
    (340. . "#3F6CFF")
    (360. . "#3F3FFF"))))


This bug report was last modified 10 years and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.