projects
/
kmrcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r8490: add dst info
[kmrcl.git]
/
color.lisp
diff --git
a/color.lisp
b/color.lisp
index 11f809eb33094e3e341acb9c329342fd3129d2a3..d674886165f061ffa5424ad2f037305339bfd65c 100644
(file)
--- a/
color.lisp
+++ b/
color.lisp
@@
-268,7
+268,7
@@
(when (<= (abs (- v1 v2)) value-range)
\r
t))
\r
(t
\r
(when (<= (abs (- v1 v2)) value-range)
\r
t))
\r
(t
\r
- (when (and (<= (
hue-difference-fixnum h1 h2
) hue-range)
\r
+ (when (and (<= (
abs (hue-difference-fixnum h1 h2)
) hue-range)
\r
(<= (abs (- v1 v2)) value-range)
\r
(<= (abs (- s1 s2)) saturation-range))
\r
t))))
\r
(<= (abs (- v1 v2)) value-range)
\r
(<= (abs (- s1 s2)) saturation-range))
\r
t))))
\r
@@
-277,7
+277,12
@@
\r
(defun hue-difference (h1 h2)
\r
"Return difference between two hues around 360 degree circle"
\r
\r
(defun hue-difference (h1 h2)
\r
"Return difference between two hues around 360 degree circle"
\r
- (when (and h1 h2)
\r
+ (cond
\r
+ ((and (null h1) (null h2))
\r
+ t)
\r
+ ((or (null h1) (null h2))
\r
+ 360)
\r
+ (t
\r
(let ((diff (- h2 h1)))
\r
(cond
\r
((< diff -180)
\r
(let ((diff (- h2 h1)))
\r
(cond
\r
((< diff -180)
\r
@@
-286,12
+291,17
@@
((> diff 180)
\r
(- (- 360 diff)))
\r
(t
\r
((> diff 180)
\r
(- (- 360 diff)))
\r
(t
\r
- diff)))))
\r
+ diff)))))
)
\r
\r
\r
(defun hue-difference-fixnum (h1 h2)
\r
"Return difference between two hues around 360 degree circle"
\r
\r
\r
(defun hue-difference-fixnum (h1 h2)
\r
"Return difference between two hues around 360 degree circle"
\r
- (when (and h1 h2)
\r
+ (cond
\r
+ ((and (null h1) (null h2))
\r
+ t)
\r
+ ((or (null h1) (null h2))
\r
+ 360)
\r
+ (t
\r
(locally (declare (type fixnum h1 h2))
\r
(let ((diff (- h2 h1)))
\r
(cond
\r
(locally (declare (type fixnum h1 h2))
\r
(let ((diff (- h2 h1)))
\r
(cond
\r
@@
-301,5
+311,5
@@
((> diff 180)
\r
(- (- 360 diff)))
\r
(t
\r
((> diff 180)
\r
(- (- 360 diff)))
\r
(t
\r
- diff))))))
\r
-
\ No newline at end of file
+ diff)))))))
\r
+
\r