예제 #1
0
        public void ShouldSetOnlyAlphaChannelToMax()
        {
            PColor color = new PColor();
            byte   red   = 0;
            byte   green = 0;
            byte   blue  = 0;
            byte   alpha = 255;

            color.SetColor(red, green, blue, alpha);


            Assert.Equal(red, color.Red);
            Assert.Equal(green, color.Green);
            Assert.Equal(blue, color.Blue);
            Assert.Equal(alpha, color.Alpha);
        }
예제 #2
0
        public void ShouldRespectDefinedColorsAndAlpha()
        {
            Random random = new Random();
            PColor color  = new PColor();
            byte   red    = (byte)random.Next(256);
            byte   green  = (byte)random.Next(256);
            byte   blue   = (byte)random.Next(256);
            byte   alpha  = (byte)random.Next(256);

            color.SetColor(red, green, blue, alpha);


            Assert.Equal(red, color.Red);
            Assert.Equal(green, color.Green);
            Assert.Equal(blue, color.Blue);
            Assert.Equal(alpha, color.Alpha);
        }