-(defun color-rgb->xyz (red green blue)
- "Converts RED GREEN BLUE colors to CIE XYZ representation.
+(defun color-srgb->xyz (red green blue)
+ "Converts RED GREEN BLUE colors from the sRGB color space to CIE XYZ.
RED, BLUE and GREEN must be between [0,1]."
(let ((r (if (<= red 0.04045)
(/ red 12.95)
RED, BLUE and GREEN must be between [0,1]."
(let ((r (if (<= red 0.04045)
(/ red 12.95)
(+ (* 0.21266729 r) (* 0.7151522 g) (* 0.0721750 b))
(+ (* 0.0193339 r) (* 0.1191920 g) (* 0.9503041 b)))))
(+ (* 0.21266729 r) (* 0.7151522 g) (* 0.0721750 b))
(+ (* 0.0193339 r) (* 0.1191920 g) (* 0.9503041 b)))))
(let ((r (+ (* 3.2404542 X) (* -1.5371385 Y) (* -0.4985314 Z)))
(g (+ (* -0.9692660 X) (* 1.8760108 Y) (* 0.0415560 Z)))
(b (+ (* 0.0556434 X) (* -0.2040259 Y) (* 1.0572252 Z))))
(let ((r (+ (* 3.2404542 X) (* -1.5371385 Y) (* -0.4985314 Z)))
(g (+ (* -0.9692660 X) (* 1.8760108 Y) (* 0.0415560 Z)))
(b (+ (* 0.0556434 X) (* -0.2040259 Y) (* 1.0572252 Z))))
(defun color-rgb->normalize (color)
"Normalize a RGB color to values between [0,1]."
(mapcar (lambda (x) (/ x 65535.0)) (x-color-values color)))
(defun color-rgb->normalize (color)
"Normalize a RGB color to values between [0,1]."
(mapcar (lambda (x) (/ x 65535.0)) (x-color-values color)))