public Color GetColorFromShape(Shape shape) { bool result = ColorDictionary.TryGetValue(shape, out Color color); if (result) { return(color); } else { return(FallbackColor); } }
/// <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;