Skip to content

Commit 104b65f

Browse files
committed
remove 'emergency use' function
1 parent 7a606ee commit 104b65f

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

src/CodeWorld/Test.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ module CodeWorld.Test (
6565
AbsPoint,
6666
AbsColor,
6767
isSameColor,
68-
equalColorCustom,
6968

7069
-- * Spatial View
7170
-- $SpatialView
@@ -361,7 +360,6 @@ import CodeWorld.Test.AbsTypes (
361360
ShapeKind,
362361
AbsPoint,
363362
isSameColor,
364-
equalColorCustom,
365363
)
366364
import CodeWorld.Test.Animation (
367365
samplesUntil,

src/CodeWorld/Test/AbsTypes.hs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module CodeWorld.Test.AbsTypes (
2323
toAbsColor,
2424
fromAbsColor,
2525
isSameColor,
26-
equalColorCustom,
2726
applyToAbsPoint,
2827
thickness,
2928
) where
@@ -185,31 +184,6 @@ isSameColor _ AnyColor = True
185184
isSameColor _ _ = False
186185

187186

188-
{- |
189-
Allows for custom thresholds on color similarity detection.
190-
This is exported to be able to correct unexpected complications in live tests.
191-
-}
192-
equalColorCustom :: Double -> Double -> Double -> Double -> AbsColor -> AbsColor -> Bool
193-
equalColorCustom hRange sRange lRange _ (Tone h1 s1 l1) (Tone h2 s2 l2)
194-
| (l2 >= 0.98 && l1 >= 0.98) ||
195-
(l2 <= 0.05 && l1 <= 0.05) = True
196-
| s1 <= 0.05 && s2 <= 0.05 = lDiff <= lRange
197-
| otherwise =
198-
hDiff <= hRange && sDiff <= sRange && lDiff <= lRange
199-
where
200-
lDiff = abs (l1 - l2)
201-
sDiff = abs (s1 - s2)
202-
hDiff = abs (h1 - h2)
203-
equalColorCustom h s l aRange (Translucent a1 c1) (Translucent a2 c2) =
204-
abs (a1 - a2) <= aRange && equalColorCustom h s l aRange c1 c2
205-
equalColorCustom h s l aRange (Translucent a c1) c =
206-
a <= aRange && equalColorCustom h s l aRange c1 c
207-
equalColorCustom h s l aRange c (Translucent a c1) =
208-
a <= aRange && equalColorCustom h s l aRange c1 c
209-
equalColorCustom _ _ _ _ AnyColor _ = True
210-
equalColorCustom _ _ _ _ _ AnyColor = True
211-
212-
213187
instance Eq AbsPoint where
214188
_ == _ = True
215189

0 commit comments

Comments
 (0)