Example #1
0
        public Color GetColorFromShape(Shape shape)
        {
            bool result = ColorDictionary.TryGetValue(shape, out Color color);

            if (result)
            {
                return(color);
            }
            else
            {
                return(FallbackColor);
            }
        }
Example #2
0
 /// <summary>
 /// Get a color by key
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public static ConsoleColor Colors(string name) => ColorDictionary.TryGetValue(name.ToLower(), out ConsoleColor color) ? color : DEFAULT_COLOR;