(let* ((fy (/ (+ L 16) 116.0))
(fz (- fy (/ b 200.0)))
(fx (+ (/ a 500.0) fy))
- (xr (if (> (expt fx 3) color-lab-ε)
- (expt fx 3)
+ (xr (if (> (expt fx 3.0) color-lab-ε)
+ (expt fx 3.0)
(/ (- (* fx 116) 16) color-lab-κ)))
(yr (if (> L (* color-lab-κ color-lab-ε))
- (expt (/ (+ L 16) 116.0) 3)
+ (expt (/ (+ L 16) 116.0) 3.0)
(/ L color-lab-κ)))
(zr (if (> (expt fz 3) color-lab-ε)
- (expt fz 3)
+ (expt fz 3.0)
(/ (- (* 116 fz) 16) color-lab-κ))))
(list (* xr Xr) ; X
(* yr Yr) ; Y
(let* ((kL (or kL 1))
(kC (or kC 1))
(kH (or kH 1))
- (C₁ (sqrt (+ (expt a₁ 2) (expt b₁ 2))))
- (C₂ (sqrt (+ (expt a₂ 2) (expt b₂ 2))))
+ (C₁ (sqrt (+ (expt a₁ 2.0) (expt b₁ 2.0))))
+ (C₂ (sqrt (+ (expt a₂ 2.0) (expt b₂ 2.0))))
(C̄ (/ (+ C₁ C₂) 2.0))
- (G (* 0.5 (- 1 (sqrt (/ (expt C̄ 7) (+ (expt C̄ 7) (expt 25 7)))))))
+ (G (* 0.5 (- 1 (sqrt (/ (expt C̄ 7.0) (+ (expt C̄ 7.0) (expt 25 7.0)))))))
(a′₁ (* (+ 1 G) a₁))
(a′₂ (* (+ 1 G) a₂))
- (C′₁ (sqrt (+ (expt a′₁ 2) (expt b₁ 2))))
- (C′₂ (sqrt (+ (expt a′₂ 2) (expt b₂ 2))))
+ (C′₁ (sqrt (+ (expt a′₁ 2.0) (expt b₁ 2.0))))
+ (C′₂ (sqrt (+ (expt a′₂ 2.0) (expt b₂ 2.0))))
(h′₁ (if (and (= b₁ 0) (= a′₁ 0))
0
(let ((v (atan b₁ a′₁)))
(* 0.24 (cos (* h̄′ 2)))
(* 0.32 (cos (+ (* h̄′ 3) (degrees-to-radians 6))))
(- (* 0.20 (cos (- (* h̄′ 4) (degrees-to-radians 63)))))))
- (Δθ (* (degrees-to-radians 30) (exp (- (expt (/ (- h̄′ (degrees-to-radians 275)) (degrees-to-radians 25)) 2)))))
- (Rc (* 2 (sqrt (/ (expt C̄′ 7) (+ (expt C̄′ 7) (expt 25 7))))))
- (Sl (+ 1 (/ (* 0.015 (expt (- L̄′ 50) 2)) (sqrt (+ 20 (expt (- L̄′ 50) 2))))))
+ (Δθ (* (degrees-to-radians 30) (exp (- (expt (/ (- h̄′ (degrees-to-radians 275)) (degrees-to-radians 25)) 2.0)))))
+ (Rc (* 2 (sqrt (/ (expt C̄′ 7.0) (+ (expt C̄′ 7.0) (expt 25.0 7.0))))))
+ (Sl (+ 1 (/ (* 0.015 (expt (- L̄′ 50) 2.0)) (sqrt (+ 20 (expt (- L̄′ 50) 2.0))))))
(Sc (+ 1 (* C̄′ 0.045)))
(Sh (+ 1 (* 0.015 C̄′ T)))
(Rt (- (* (sin (* Δθ 2)) Rc))))
- (sqrt (+ (expt (/ ΔL′ (* Sl kL)) 2)
- (expt (/ ΔC′ (* Sc kC)) 2)
- (expt (/ ΔH′ (* Sh kH)) 2)
+ (sqrt (+ (expt (/ ΔL′ (* Sl kL)) 2.0)
+ (expt (/ ΔC′ (* Sc kC)) 2.0)
+ (expt (/ ΔH′ (* Sh kH)) 2.0)
(* Rt (/ ΔC′ (* Sc kC)) (/ ΔH′ (* Sh kH)))))))))
(provide 'color-lab)