aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/color.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/color.spad.pamphlet')
-rw-r--r--src/algebra/color.spad.pamphlet6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/algebra/color.spad.pamphlet b/src/algebra/color.spad.pamphlet
index 4899d450..76b8ea9b 100644
--- a/src/algebra/color.spad.pamphlet
+++ b/src/algebra/color.spad.pamphlet
@@ -112,7 +112,7 @@ Color(): Exports == Implementation where
x := y
y := c
diff := x.hue - y.hue
- if (xHueSmaller:= (diff < 0)) then diff := -diff
+ if (xHueSmaller:= negative? diff) then diff := -diff
if (moreThanHalf:=(diff > totalHues quo 2)) then diff := totalHues-diff
offset : I := wholePart(round (diff::SF/(2::SF)**(x.weight/y.weight)) )
if (xHueSmaller and not moreThanHalf)
@@ -121,7 +121,7 @@ Color(): Exports == Implementation where
ans := x.hue + offset
else
ans := x.hue - offset
- if (ans < 0) then ans := totalHues + ans
+ if negative? ans then ans := totalHues + ans
else if (ans > totalHues) then ans := ans - totalHues
[ans,1]
@@ -136,7 +136,7 @@ Color(): Exports == Implementation where
numberOfHues() == totalHues
color i ==
- if (i<0) or (i>totalHues) then
+ if negative? i or (i>totalHues) then
error concat("Color should be in the range 1..",totalHues::String)
[i::I, 1]