public static IDictionary <String, String> Get(String json, Theme theme) { var themes = JsonConvert.DeserializeObject <Brightnesses>(json); var brightness = theme.Brightness(); var color = theme.Color(); return(themes[brightness].Values .Union(themes[brightness].Colors[color]) .ToDictionary(t => t.Key, t => t.Value)); }
public static ThemeColor Color(this Theme theme) { return(theme == Theme.None ? ThemeColor.None : (ThemeColor)((Int32)theme / (Int32)theme.Brightness())); }