emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110288: * lisp/facemenu.el (list-col


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110288: * lisp/facemenu.el (list-colors-sort): Add option "Luminance".
Date: Sun, 30 Sep 2012 19:36:42 +0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110288
fixes bug: http://debbugs.gnu.org/10181
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Sun 2012-09-30 19:36:42 +0300
message:
  * lisp/facemenu.el (list-colors-sort): Add option "Luminance".
  (list-colors-sort-key): Implement it.
  
  * lisp/vc/diff-mode.el (diff-refine-removed):
  * lisp/vc/ediff-init.el (ediff-fine-diff-A):
  * lisp/vc/smerge-mode.el (smerge-refined-removed):
  Change background color "#ffaaaa" to "#ffbbbb".
modified:
  lisp/ChangeLog
  lisp/facemenu.el
  lisp/vc/diff-mode.el
  lisp/vc/ediff-init.el
  lisp/vc/smerge-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-30 13:43:47 +0000
+++ b/lisp/ChangeLog    2012-09-30 16:36:42 +0000
@@ -1,3 +1,13 @@
+2012-09-30  Juri Linkov  <address@hidden>
+
+       * facemenu.el (list-colors-sort): Add option "Luminance".
+       (list-colors-sort-key): Implement it.
+
+       * vc/diff-mode.el (diff-refine-removed):
+       * vc/ediff-init.el (ediff-fine-diff-A):
+       * vc/smerge-mode.el (smerge-refined-removed):
+       Change background color "#ffaaaa" to "#ffbbbb".  (Bug#10181)
+
 2012-09-30  Jan Djärv  <address@hidden>
 
        * term/ns-win.el (x-file-dialog): New function.

=== modified file 'lisp/facemenu.el'
--- a/lisp/facemenu.el  2012-05-04 05:14:14 +0000
+++ b/lisp/facemenu.el  2012-09-30 16:36:42 +0000
@@ -464,7 +464,8 @@
 `(rgb-dist . COLOR)' sorts by the RGB distance to the specified color.
 `hsv' sorts by hue, saturation, value.
 `(hsv-dist . COLOR)' sorts by the HSV distance to the specified color
-and excludes grayscale colors."
+and excludes grayscale colors.
+`luminance' sorts by relative luminance in the CIE XYZ color space."
   :type '(choice (const :tag "Unsorted" nil)
                 (const :tag "Color Name" name)
                 (const :tag "Red-Green-Blue" rgb)
@@ -474,7 +475,8 @@
                 (const :tag "Hue-Saturation-Value" hsv)
                 (cons :tag "Distance on HSV cylinder"
                       (const :tag "Distance from Color" hsv-dist)
-                      (color :tag "Source Color Name")))
+                      (color :tag "Source Color Name"))
+                (const :tag "Luminance" luminance))
   :group 'facemenu
   :version "24.1")
 
@@ -504,7 +506,12 @@
        (+ (expt (- 180 (abs (- 180 (abs (- (nth 0 c-hsv) ; wrap hue
                                            (nth 0 o-hsv)))))) 2)
           (expt (- (nth 1 c-hsv) (nth 1 o-hsv)) 2)
-          (expt (- (nth 2 c-hsv) (nth 2 o-hsv)) 2)))))))
+          (expt (- (nth 2 c-hsv) (nth 2 o-hsv)) 2)))))
+   ((eq list-colors-sort 'luminance)
+    (let ((c-rgb (color-name-to-rgb color)))
+      (+ (* (nth 0 c-rgb) 0.21266729)
+        (* (nth 1 c-rgb) 0.7151522)
+        (* (nth 2 c-rgb) 0.0721750))))))
 
 (defun list-colors-display (&optional list buffer-name callback)
   "Display names of defined colors, and show what they look like.

=== modified file 'lisp/vc/diff-mode.el'
--- a/lisp/vc/diff-mode.el      2012-09-10 14:40:13 +0000
+++ b/lisp/vc/diff-mode.el      2012-09-30 16:36:42 +0000
@@ -1899,7 +1899,7 @@
   '((default
      :inherit diff-refine-change)
     (((class color) (min-colors 88) (background light))
-     :background "#ffaaaa")
+     :background "#ffbbbb")
     (((class color) (min-colors 88) (background dark))
      :background "#aa2222"))
   "Face used for removed characters shown by `diff-refine-hunk'."

=== modified file 'lisp/vc/ediff-init.el'
--- a/lisp/vc/ediff-init.el     2012-09-25 04:13:02 +0000
+++ b/lisp/vc/ediff-init.el     2012-09-30 16:36:42 +0000
@@ -979,7 +979,7 @@
 (defface ediff-fine-diff-A
   (if (featurep 'emacs)
       '((((class color) (min-colors 88) (background light))
-        :background "#ffaaaa")
+        :background "#ffbbbb")
        (((class color) (min-colors 88) (background dark))
         :background "#aa2222")
        (((class color) (min-colors 16))

=== modified file 'lisp/vc/smerge-mode.el'
--- a/lisp/vc/smerge-mode.el    2012-08-15 16:29:11 +0000
+++ b/lisp/vc/smerge-mode.el    2012-09-30 16:36:42 +0000
@@ -132,7 +132,7 @@
   '((default
      :inherit smerge-refined-change)
     (((class color) (min-colors 88) (background light))
-     :background "#ffaaaa")
+     :background "#ffbbbb")
     (((class color) (min-colors 88) (background dark))
      :background "#aa2222")
     (t :inverse-video t))


reply via email to

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