Signed-off-by: Julien Danjou <julien@danjou.info>
+2012-01-19 Julien Danjou <julien@danjou.info>
+
+ * color.el (color-name-to-rgb): Use the white color to find the max
+ color component value and return correctly computed values.
+
2012-01-10 Teodor Zlatanov <tzz@lifelogs.com>
* nntp.el (nntp-send-authinfo): Query `auth-source-search' with the
2012-01-10 Teodor Zlatanov <tzz@lifelogs.com>
* nntp.el (nntp-send-authinfo): Query `auth-source-search' with the
Optional arg FRAME specifies the frame where the color is to be
displayed. If FRAME is omitted or nil, use the selected frame.
If FRAME cannot display COLOR, return nil."
Optional arg FRAME specifies the frame where the color is to be
displayed. If FRAME is omitted or nil, use the selected frame.
If FRAME cannot display COLOR, return nil."
- (mapcar (lambda (x) (/ x 65535.0)) (color-values color frame)))
+ ;; `colors-values' maximum value is either 65535 or 65280 depending on the
+ ;; display system. So we use a white conversion to get the max value.
+ (let ((valmax (car (color-values "#ffffff"))))
+ (mapcar (lambda (x) (/ x valmax)) (color-values color frame))))
(defun color-rgb-to-hex (red green blue)
"Return hexadecimal notation for the color RED GREEN BLUE.
(defun color-rgb-to-hex (red green blue)
"Return hexadecimal notation for the color RED GREEN BLUE.