public static JsonPalette Auto(ConsoleBrush defaultBrush)
{
string setting;
try
{
setting = Settings.Default[defaultBrush.Background + "Palette"];
}
catch (KeyNotFoundException)
{
setting = null;
}
if (string.IsNullOrEmpty(setting))
{
setting = Settings.BlackPalette;
defaultBrush = new ConsoleBrush(ConsoleColor.White, ConsoleColor.Black);
}
var palette = new JsonPalette(defaultBrush);
palette.ImportJson(setting);
return(palette);
}