SHARE
TWEET

Untitled

a guest Jun 25th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static List<Color> GetAllColors()
  2.         {
  3.             List<Color> aallColors = new List<Color>();
  4.  
  5.             foreach (PropertyInfo property in typeof(Color).GetProperties())
  6.             {
  7.                 if (property.PropertyType == typeof(Color))
  8.                 {
  9.                     aallColors.Add((Color)property.GetValue(null));
  10.                 }
  11.             }
  12.  
  13.             return aallColors;
  14.         }
  15.      
  16. Console.Clear();
  17. Console.WriteLine("Введите цвет:");
  18. allColors = GetAllColors();
  19. for(int i = 1; i < allColors.Count(); i++)
  20. {
  21.     try
  22.     {
  23.         Colorful.Console.Write(allColors[i].Name + " ", allColors[i]);
  24.     }
  25.     catch { }
  26. }
  27. Console.ReadLine();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top