diff lisp/gnus/shr-color.el @ 111701:3fbe2d0ad0f8

color-lab.el: Fix all expt calls to use float type. shr-color.el: only return hexadecimal part of colors. shr.el: Protect against non-existant colour names.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 24 Nov 2010 11:32:22 +0000
parents c63f96430f63
children cad125981c0f
line wrap: on
line diff
--- a/lisp/gnus/shr-color.el	Wed Nov 24 08:50:08 2010 +0100
+++ b/lisp/gnus/shr-color.el	Wed Nov 24 11:32:22 2010 +0000
@@ -231,10 +231,10 @@
   (when color
     (cond
      ;; Hexadecimal color: #abc or #aabbcc
-     ((string-match-p
-       "#[0-9a-fA-F]\\{3\\}[0-9a-fA-F]\\{3\\}?"
+     ((string-match
+       "\\(#[0-9a-fA-F]\\{3\\}[0-9a-fA-F]\\{3\\}?\\)"
        color)
-      color)
+      (match-string 1 color))
      ;; rgb() or rgba() colors
      ((or (string-match
            "rgb(\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*)"