Signed-off-by: Julien Danjou <julien@danjou.info>
2010-11-24 Julien Danjou <julien@danjou.info>
+ * shr.el (shr-insert-color-overlay): Remove specific rgb() check.
+
+ * shr-color.el (shr-color->hexadecimal): Only return the hexadecimal
+ matched part.
+
* color-lab.el: Fix all expt calls to use float type.
2010-11-24 Katsumi Yamaoka <yamaoka@jpl.org>
(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*)"
(defun shr-insert-color-overlay (color start end)
(when color
- (when (and (not (string-match "\\`rgb([^\)]+)\\'" color))
- (string-match " " color))
- (setq color (car (split-string color))))
(let ((overlay (make-overlay start end)))
(overlay-put overlay 'face (cons 'foreground-color
(cadr (shr-color-check color)))))))