public void randomize() { colors col = new colors(); Random rand = new Random(); foreach (Ellipse e in foo) { int option = rand.Next(1, 7); switch (option) { case 1: e.Fill = col.red; break; case 2: e.Fill = col.orange; break; case 3: e.Fill = col.indigo; break; case 4: e.Fill = col.violet; break; case 5: e.Fill = col.blue; break; case 6: e.Fill = col.green; break; } } }
public void gray(int from = 0, int to = 4) { if (from < 0 || to > 4) return; colors col = new colors(); for (int i = from; i < to; i++) { foo[i].Fill = col.gray; } }