Exemplo n.º 1
0
        public void IsKnownColorTest()
        {
            ExtendedColors ec = ExtendedColors.FromName("MareaBaja");

            Assert.AreEqual(true, ec.IsKnownColor);

            ExtendedColors ec2 = ExtendedColors.FromArgb(unchecked ((int)0xFF795482));

            Assert.AreEqual(false, ec2.IsKnownColor);
        }
Exemplo n.º 2
0
        public void IsNamedColorTest()
        {
            ExtendedColors ec = ExtendedColors.FromName("VodoYellow");

            Assert.AreEqual(true, ec.IsNamedColor);

            ExtendedColors ec2 = ExtendedColors.FromArgb(unchecked ((int)0xFF795482));

            Assert.AreEqual(false, ec2.IsNamedColor);
        }
Exemplo n.º 3
0
        private void DropdownControl2_DrawTextArea(object sender, DrawTextAreaEventArgs e)
        {
            Rectangle bounds   = e.TextArea;
            Rectangle scolor   = new Rectangle(bounds.X, bounds.Y, 12, bounds.Height);
            Rectangle textArea = new Rectangle(bounds.X + 12, bounds.Y, bounds.Width - 12, bounds.Height);

            using (SolidBrush sb = new SolidBrush(SystemColors.HighlightText))
            {
                e.Graphics.FillRectangle(sb, e.TextArea);
            }

            using (SolidBrush sb = new SolidBrush(ExtendedColors.FromName(ColorName)))
            {
                e.Graphics.FillRectangle(sb, scolor);
            }

            TextRenderer.DrawText(e.Graphics, ColorName, this.Font, textArea, Color.Black, TextFormatFlags.EndEllipsis);
        }
Exemplo n.º 4
0
        public void ALPATest()
        {
            ExtendedColors ec = ExtendedColors.FromName("MareaBaja");

            Assert.AreEqual(255, ec.A);
        }
Exemplo n.º 5
0
        public void BLUTest()
        {
            ExtendedColors ec = ExtendedColors.FromName("MareaBaja");

            Assert.AreEqual(100, ec.B);
        }
Exemplo n.º 6
0
        public void GRNTest()
        {
            ExtendedColors ec = ExtendedColors.FromName("MareaBaja");

            Assert.AreEqual(84, ec.G);
        }
Exemplo n.º 7
0
        public void RedTest()
        {
            ExtendedColors ec = ExtendedColors.FromName("MareaBaja");

            Assert.AreEqual(46, ec.R);
        }
Exemplo n.º 8
0
        public void NameTest()
        {
            ExtendedColors ec = ExtendedColors.FromName("MareaBaja");

            Assert.AreEqual("MareaBaja", ec.Name);
        }