;;; facemenu.el --- create a face menu for interactively adding fonts to text
-;; Copyright (C) 1994-1996, 2001-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2001-2016 Free Software Foundation, Inc.
;; Author: Boris Goldowsky <boris@gnu.org>
;; Keywords: faces
(defcustom list-colors-sort nil
"Color sort order for `list-colors-display'.
-`nil' means default implementation-dependent order (defined in `x-colors').
+nil means default implementation-dependent order (defined in `x-colors').
`name' sorts by color name.
`rgb' sorts by red, green, blue components.
`(rgb-dist . COLOR)' sorts by the RGB distance to the specified color.
'help-echo
(let ((hsv (apply 'color-rgb-to-hsv
(color-name-to-rgb (car color)))))
- (format "H:%d S:%d V:%d"
+ (format "H:%.2f S:%.2f V:%.2f"
(nth 0 hsv) (nth 1 hsv) (nth 2 hsv)))))
(when callback
(make-text-button
(defun list-colors-duplicates (&optional list)
"Return a list of colors with grouped duplicate colors.
If a color has no duplicates, then the element of the returned list
-has the form '(COLOR-NAME). The element of the returned list with
-duplicate colors has the form '(COLOR-NAME DUPLICATE-COLOR-NAME ...).
+has the form (COLOR-NAME). The element of the returned list with
+duplicate colors has the form (COLOR-NAME DUPLICATE-COLOR-NAME ...).
This function uses the predicate `facemenu-color-equal' to compare
color names. If the optional argument LIST is non-nil, it should
be a list of colors to display. Otherwise, this function uses
face
(facemenu-active-faces
(cons face
- (if (listp prev)
+ (if (face-list-p prev)
prev
(list prev)))
;; Specify the selected frame