RGB цвет C# WinForms, как использовать?
Как использовать данный код на текст? C#
public Form1()
{
InitializeComponent();
timer1.Interval = 20;
timer1.Enabled = true;
}
float step = 0;
Color currentColor = Color.DarkGreen;
Color targetColor = Color.LightBlue;
Random rnd = new Random();
private void timer1_Tick(object sender, EventArgs e)
{
if (step >= 1f)
{
step = 0;
int R = rnd.Next(0, 255);
int G = rnd.Next(0, 255);
int B = rnd.Next(0, 255);
currentColor = targetColor;
targetColor = Color.FromArgb(R, G, B);
}
int mixR = (int)(currentColor.R * (1f - step) + targetColor.R * step);
int mixG = (int)(currentColor.G * (1f - step) + targetColor.G * step);
int mixB = (int)(currentColor.B * (1f - step) + targetColor.B * step);
this.BackColor = Color.FromArgb(mixR, mixG, mixB);
step += 0.03f;
}