]> code.delx.au - gnu-emacs/commitdiff
* lisp/facemenu.el (list-colors-sort): Add option "Luminance".
authorJuri Linkov <juri@jurta.org>
Sun, 30 Sep 2012 16:36:42 +0000 (19:36 +0300)
committerJuri Linkov <juri@jurta.org>
Sun, 30 Sep 2012 16:36:42 +0000 (19:36 +0300)
(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".

Fixes: debbugs:10181
lisp/ChangeLog
lisp/facemenu.el
lisp/vc/diff-mode.el
lisp/vc/ediff-init.el
lisp/vc/smerge-mode.el

index 5d1a7eea0954a9ac09edd476dce6461d121e1937..4ac0f1d451e7cc7682bf76887d53a6002844644f 100644 (file)
@@ -1,3 +1,13 @@
+2012-09-30  Juri Linkov  <juri@jurta.org>
+
+       * 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  <jan.h.d@swipnet.se>
 
        * term/ns-win.el (x-file-dialog): New function.
index bcef25eb893173cd0f64b39059bd5985f1d91ccb..88b9ddc7f54f036a8f866304be8af37fc38b0c0f 100644 (file)
@@ -464,7 +464,8 @@ These special properties include `invisible', `intangible' and `read-only'."
 `(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 @@ and excludes grayscale colors."
                 (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 @@ filter out the color from the output."
        (+ (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.
index 11ec785b647349725240fc97d3f830c2f3830548..586dd2b75e2df6bedc4ab996d4c97ee2e456ff0c 100644 (file)
@@ -1899,7 +1899,7 @@ For use in `add-log-current-defun-function'."
   '((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'."
index 2c41ce8c457ca45412b8b20a5e0bd83719044503..65776dfccad3b5a2efafddc6e23151f03ed63752 100644 (file)
@@ -979,7 +979,7 @@ this variable represents.")
 (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))
index babcf6f1beb8bde469d8556e080071e49d1acf27..7037b606fe7663be4e9b5c2556cc06f2ca367616 100644 (file)
@@ -132,7 +132,7 @@ Used in `smerge-diff-base-mine' and related functions."
   '((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))