Ejemplo n.º 1
0
        public void GetSetTests()
        {
            PaintColor paintColor = new PaintColor();

            Assert.AreEqual(0, paintColor.A);
            Assert.AreEqual(0, paintColor.R);
            Assert.AreEqual(0, paintColor.G);
            Assert.AreEqual(0, paintColor.B);

            Color color = paintColor.ToColor();

            Assert.AreEqual(0, color.A);
            Assert.AreEqual(0, color.R);
            Assert.AreEqual(0, color.G);
            Assert.AreEqual(0, color.B);

            paintColor.A = 255;
            paintColor.R = 100;
            paintColor.G = 50;
            paintColor.B = 67;

            Assert.AreEqual(255, paintColor.A);
            Assert.AreEqual(100, paintColor.R);
            Assert.AreEqual(50, paintColor.G);
            Assert.AreEqual(67, paintColor.B);

            color = paintColor.ToColor();
            Assert.AreEqual(255, color.A);
            Assert.AreEqual(100, color.R);
            Assert.AreEqual(50, color.G);
            Assert.AreEqual(67, color.B);
        }
Ejemplo n.º 2
0
        public void ConstructorRGBTest()
        {
            PaintColor paintColor = new PaintColor(20, 30, 35);

            Assert.AreEqual(255, paintColor.A);
            Assert.AreEqual(20, paintColor.R);
            Assert.AreEqual(30, paintColor.G);
            Assert.AreEqual(35, paintColor.B);

            Color color = paintColor.ToColor();

            Assert.AreEqual(255, color.A);
            Assert.AreEqual(20, color.R);
            Assert.AreEqual(30, color.G);
            Assert.AreEqual(35, color.B);
        }
Ejemplo n.º 3
0
        public void ConstructorColorTest()
        {
            PaintColor paintColor = new PaintColor(Color.FromArgb(40, 20, 30, 35));

            Assert.AreEqual(40, paintColor.A);
            Assert.AreEqual(20, paintColor.R);
            Assert.AreEqual(30, paintColor.G);
            Assert.AreEqual(35, paintColor.B);

            Color color = paintColor.ToColor();

            Assert.AreEqual(40, color.A);
            Assert.AreEqual(20, color.R);
            Assert.AreEqual(30, color.G);
            Assert.AreEqual(35, color.B);
        }
Ejemplo n.º 4
0
 public PaintPen(PaintColor color, float width)
 {
     _pen = new Pen(color.ToColor(), width);
 }
Ejemplo n.º 5
0
 public PaintPen(PaintColor color)
 {
     _pen = new Pen(color.ToColor());
 }
Ejemplo n.º 6
0
 public PaintSolidBrush(PaintColor color)
 {
     _brush = new SolidBrush(color.ToColor());
 }
Ejemplo n.º 7
0
 public void Clear(PaintColor color)
 {
     _graphics.Clear(color.ToColor());
 }