Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static List<Color> GetAllColors()
- {
- List<Color> aallColors = new List<Color>();
- foreach (PropertyInfo property in typeof(Color).GetProperties())
- {
- if (property.PropertyType == typeof(Color))
- {
- aallColors.Add((Color)property.GetValue(null));
- }
- }
- return aallColors;
- }
- Console.Clear();
- Console.WriteLine("Введите цвет:");
- allColors = GetAllColors();
- for(int i = 1; i < allColors.Count(); i++)
- {
- try
- {
- Colorful.Console.Write(allColors[i].Name + " ", allColors[i]);
- }
- catch { }
- }
- Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement