 
   color1.mixWith$(color2)
 
-  equals color1.r, 30
-  equals color1.g, (45 / 2).round()
-  equals color1.b, (76 / 2).round()
-  equals color1.a, 0.5 / 2
+  equalEnough color1.r, 30
+  equalEnough color1.g, (45 / 2).round()
+  equalEnough color1.b, (76 / 2).round()
+  equalEnough color1.a, 0.5 / 2
 
   color3.mixWith$(color2, 0.1)
 
-  equals color3.r, ((50 * 0.1) + (10 * 0.9)).round()
-  equals color3.g, ((40 * 0.1) + (5 * 0.9)).round()
-  equals color3.b, ((60 * 0.1) + (16 * 0.9)).round()
-  equals color3.a, (0.3 * 0.1) + (0.2 * 0.9) 
+  equalEnough color3.r, ((50 * 0.1) + (10 * 0.9)).round()
+  equalEnough color3.g, ((40 * 0.1) + (5 * 0.9)).round()
+  equalEnough color3.b, ((60 * 0.1) + (16 * 0.9)).round()
+  equalEnough color3.a, (0.3 * 0.1) + (0.2 * 0.9) 
 
 test "Color.random", ->
   color = Color2.random()


  mixedColor = Color2.mix(color1, color2)

  equals mixedColor.r, 30
  equals mixedColor.g, (45 / 2).round()
  equals mixedColor.b, (76 / 2).round()
  equals mixedColor.a, 0.5 / 2

  weightedMixedColor = Color2.mix(color1, color2, 0.1)

  equals weightedMixedColor.r, ((50 * 0.1) + (10 * 0.9)).round()
  equals weightedMixedColor.g, ((40 * 0.1) + (5 * 0.9)).round()
  equals weightedMixedColor.b, ((60 * 0.1) + (16 * 0.9)).round()
  equals weightedMixedColor.a, (0.3 * 0.1) + (0.2 * 0.9)  

test "accepts named colors", ->
  white = Color2("white")

  equals white.r, 255
  equals white.g, 255
  equals white.b, 255
  equals white.a, 1.0

  piPink = Color2("Paul Irish Pink")

  equals piPink.r, 255
  equals piPink.g, 94
  equals piPink.b, 153
  equals piPink.a, 1.0

module()


  ok 0 <= color.r <= 255
  ok 0 <= color.g <= 255
  ok 0 <= color.b <= 255
  equalEnough color.a, 1.0

test "Color.mix", ->
  color1 = Color2(50, 40, 60, 0.3)
