import toxi.math.MathUtils;
public class ColorTest extends TestCase {
public void testCMYK() {
ReadonlyTColor c = TColor.newHex("00ffff");
assertEquals(1f, c.cyan());
assertEquals(0f, c.magenta());
assertEquals(0f, c.yellow());
assertEquals(0f, c.black());
assertEquals(0f, TColor.WHITE.black());
assertEquals(1f, TColor.BLACK.black());
assertEquals(1f, TColor.YELLOW.yellow());
assertEquals(0f, TColor.YELLOW.cyan());
assertEquals(1f, TColor.MAGENTA.magenta());
// rgb conversion
assertEquals(0f, TColor.GREEN.magenta());
assertEquals(1f, TColor.GREEN.cyan());
assertEquals(1f, TColor.GREEN.yellow());
assertEquals(1f, TColor.RED.magenta());
assertEquals(1f, TColor.RED.yellow());
assertEquals(0f, TColor.RED.cyan());
c = TColor.RED.getDarkened(0.25f);
assertEquals(0.75f, c.magenta());
assertEquals(0.25f, c.black());
}