;;; shr-color.el --- Simple HTML Renderer color management
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
;; Author: Julien Danjou <julien@danjou.info>
;; Keywords: html
;;; Code:
-(require 'color-lab)
+(require 'color)
+(eval-when-compile (require 'cl))
(defgroup shr-color nil
"Simple HTML Renderer colors"
(defcustom shr-color-visible-distance-min 5
"Minimum color distance between two colors to be considered visible.
-This value is used to compare result for `ciede2000'. Its an
+This value is used to compare result for `ciede2000'. It's an
absolute value without any unit."
:group 'shr
:type 'integer)
Each entry should have the form (COLOR-NAME . HEXADECIMAL-COLOR).")
(defun shr-color-relative-to-absolute (number)
- "Convert a relative NUMBER to absolute. If NUMBER is absolute, return NUMBER.
+ "Convert a relative NUMBER to absolute.
+If NUMBER is absolute, return NUMBER.
This will convert \"80 %\" to 204, \"100 %\" to 255 but \"123\" to \"123\"."
(let ((string-length (- (length number) 1)))
;; Is this a number with %?