Ejemplo n.º 1
0
        public void FindPurpleByValue()
        {
            Map map = new Map(new GDIPlus_TextMetrics(), null);

            using (map.Write()) {
                map.AddColor("Purple 50%", 14, 0, 0.5F, 0, 0, false);
                map.AddColor("Purplicious", 11, 0.2F, 1F, 0.1F, 0.08F, false);
                map.AddColor("Blue", 12, 0.95F, 0.35F, 0, 0, false);
                map.AddColor("Black", 88, 0, 0, 0, 1F, false);
            }

            short           ocadId;
            float           c, m, y, k;
            List <SymColor> colorList;

            using (map.Read())
                colorList = new List <SymColor>(map.AllColors);

            Assert.IsTrue(FindPurple.FindPurpleColor(colorList, out ocadId, out c, out m, out y, out k));
            Assert.AreEqual(11, ocadId);
            Assert.AreEqual(0.2F, c);
            Assert.AreEqual(1F, m);
            Assert.AreEqual(0.1F, y);
            Assert.AreEqual(0.08F, k);
        }
Ejemplo n.º 2
0
 public void IsPurple()
 {
     Assert.IsTrue(FindPurple.IsPurple(0, 1, 0, 0));
     Assert.IsTrue(FindPurple.IsPurple(0.43F, 0.78F, 0.22F, 0));
     Assert.IsFalse(FindPurple.IsPurple(0.95F, 0.30F, 0, 0));
     Assert.IsFalse(FindPurple.IsPurple(0, 1F, 0, 0.9F));
     Assert.IsFalse(FindPurple.IsPurple(0, 0F, 0, 0));
 }
Ejemplo n.º 3
0
        public void NoPurple()
        {
            Map map = new Map(new GDIPlus_TextMetrics(), null);

            using (map.Write()) {
                map.AddColor("Yellow", 11, 0.0F, 0.25F, 0.79F, 0.08F, false);
                map.AddColor("Blue", 12, 0.95F, 0.35F, 0, 0, false);
                map.AddColor("Black", 88, 0, 0, 0, 1F, false);
            }

            short           ocadId;
            float           c, m, y, k;
            List <SymColor> colorList;

            using (map.Read())
                colorList = new List <SymColor>(map.AllColors);

            Assert.IsFalse(FindPurple.FindPurpleColor(colorList, out ocadId, out c, out m, out y, out k));
        }