private void GradientColorPickerAbout_Load(object sender, EventArgs e) { Version.Text = $"Version: v{typeof(GradientColorPicker).Assembly.GetName().Version}"; random = new Random(DateTime.Now.Millisecond); Eye.Image = new Bitmap(Eye.ClientSize.Width, Eye.ClientSize.Height); EyeGradientColorPicker.AddColor(Color.White, 0.2631579f); EyeGradientColorPicker.AddColor(Color.FromArgb(255, 0, 95, 140), 0.4385965f); EyeGradientColorPicker.AddColor(Color.FromArgb(255, 0, 114, 168), 0.649122834f); EyeGradientColorPicker.AddColor(Color.Black, 0.78245616f); #if DEBUG EyeGradientColorPicker.DrawColorPosition = false; #endif timer1.Interval = 500; timer1_Tick(this, e); }
private void Eye_Paint(object sender, PaintEventArgs e) { var centerPoint = new PointF(random.Next(10, 42), random.Next(10, 42)); EyeGradientColorPicker.DrawRadialGradient(e.Graphics, Eye.ClientRectangle, centerPoint); }