Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int[] R = { 0, 51, 102, 153, 204, 255 };
- int[] B = { 128, 152, 177, 201, 226, 250 };
- int nGradientColors = B.Length-1;
- int nColorsBetween = 255/nGradientColors;
- Console.WriteLine(nColorsBetween);
- for (int i = 0; i < B.Length - 1; i++)
- {//пробегаемся по цветам градиента
- double step = (double)(B[i + 1] - B[i]) / (nColorsBetween );//шаг
- double colorValue = B[i];//начальный цвет
- for (int j = 0; j < nColorsBetween; j++)
- { //пробегаемся по диапазону между цветами
- int colorIntValue = (int)colorValue; //целое значение
- Console.WriteLine(colorIntValue);
- colorValue += step;
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement