Adds additional shade/tint tests.
@@ -12,6 +12,20 @@ public class ColorFunctionsTest {
ColorFunctions.shade(null, 1);
}
+ @Test
+ public void testShade_withAboveOneShadeFactor() {
+ final Color color = new Color(255, 255, 255);
+ final Color shadedColor = ColorFunctions.shade(color, 1);
+ Assert.assertEquals(Color.BLACK, shadedColor);
+ }
+
+ @Test
+ public void testShade_withBelowZeroShadeFactor() {
+ final Color color = new Color(255, 255, 255);
+ final Color shadedColor = ColorFunctions.shade(color, 0);
+ Assert.assertEquals(color, shadedColor);
+ }
+
@Test
public void testShade_withZeroShadeFactor() {
final Color color = new Color(255, 255, 255);
@@ -44,6 +58,20 @@ public class ColorFunctionsTest {
ColorFunctions.shade(null, 1);
}
+ @Test
+ public void testTint_withAboveOneTintFactor() {
+ final Color color = new Color(0, 0, 0);
+ final Color tintedColor = ColorFunctions.tint(color, 0);
+ Assert.assertEquals(color, tintedColor);
+ }
+
+ @Test
+ public void testTint_withBelowZeroTintFactor() {
+ final Color color = new Color(0, 0, 0);
+ final Color tintedColor = ColorFunctions.tint(color, 1);
+ Assert.assertEquals(Color.WHITE, tintedColor);
+ }
+
@Test
public void testTint_withZeroTintFactor() {
final Color color = new Color(0, 0, 0);
