Beispiel #1
0
        private void RandomSeedColor_Click(object sender, EventArgs e)
        {
            ColorManiplator maniplator = new ColorManiplator();

            maniplator.RandomColor();

            SetPanelAndLabel(ColorBox1, ColorLabel1, maniplator.GetColor(), maniplator.TextContrastColor());
        }
Beispiel #2
0
        private void SetSeedColor_Click(object sender, EventArgs e)
        {
            SeedColorPicker.AllowFullOpen = true;
            SeedColorPicker.ShowHelp      = true;
            SeedColorPicker.Color         = ColorBox1.BackColor;

            if (SeedColorPicker.ShowDialog() == DialogResult.OK)
            {
                ColorManiplator maniplator = new ColorManiplator(SeedColorPicker.Color);
                SetPanelAndLabel(ColorBox1, ColorLabel1, maniplator.GetColor(), maniplator.TextContrastColor());
            }
        }
Beispiel #3
0
        private void Generate_Click(object sender, EventArgs e)
        {
            ColorManiplator maniplator = new ColorManiplator(ColorBox1.BackColor);

            maniplator.MonochromaticShift();
            SetPanelAndLabel(ColorBox2, ColorLabel2, maniplator.GetColor(), maniplator.TextContrastColor());

            maniplator = new ColorManiplator(ColorBox1.BackColor);
            maniplator.AnalogousShift();
            SetPanelAndLabel(ColorBox3, ColorLabel3, maniplator.GetColor(), maniplator.TextContrastColor());

            maniplator.AnalogousShift();
            SetPanelAndLabel(ColorBox4, ColorLabel4, maniplator.GetColor(), maniplator.TextContrastColor());

            maniplator.AnalogousShift();
            SetPanelAndLabel(ColorBox5, ColorLabel5, maniplator.GetColor(), maniplator.TextContrastColor());
        }
Beispiel #4
0
        private Bitmap GenerateImage()
        {
            Bitmap   bmp      = new Bitmap(1000, 600);
            Graphics graphics = Graphics.FromImage(bmp);

            for (int i = 0; i < 5; i++)
            {
                SolidBrush textbrush  = new SolidBrush(ColorManiplator.TextContrastColor(colors[i]));
                SolidBrush colorbrush = new SolidBrush(colors[i]);
                Font       font       = new Font("Cascadia Code", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));

                graphics.FillRectangle(colorbrush, (i * 200), 0, 200, 600);
                graphics.DrawString(ColorManiplator.ColorHexCode(colors[i]), font, textbrush, ((i * 200) + 64), 500);
            }
            graphics.Save();
            return(bmp);
        }
Beispiel #5
0
 private void SetPanelAndLabel(Panel panel, Label label, Color color, Color textcolor)
 {
     panel.BackColor = color;
     label.Text      = ColorManiplator.ColorHexCode(color);
     label.ForeColor = textcolor;
 }