put console attributes in own variable

This commit is contained in:
Patrick Kranz 2019-04-02 18:56:14 +02:00
parent a247624e90
commit 2661fbe0b9
3 changed files with 6 additions and 3 deletions

View file

@ -154,7 +154,8 @@ namespace ColorTool
if (colorTable != null)
{
return new ColorScheme { colorTable = colorTable, consoleAttributes = new ConsoleAttributes { background = backgroundColor, foreground = foregroundColor, popupBackground = popupBackgroundColor, popupForeground = popupForegroundColor } };
var consoleAttributes = new ConsoleAttributes { background = backgroundColor, foreground = foregroundColor, popupBackground = popupBackgroundColor, popupForeground = popupForegroundColor };
return new ColorScheme { colorTable = colorTable, consoleAttributes = consoleAttributes };
}
else
{

View file

@ -116,7 +116,8 @@ namespace ColorTool
}
}
return new ColorScheme { colorTable = colorTable, consoleAttributes = new ConsoleAttributes { background = screenBackground, foreground = screenForeground, popupBackground = popupBackground, popupForeground = popupForeground } };
var consoleAttributes = new ConsoleAttributes { background = screenBackground, foreground = screenForeground, popupBackground = popupBackground, popupForeground = popupForeground };
return new ColorScheme { colorTable = colorTable, consoleAttributes = consoleAttributes };
}
catch (Exception /*e*/)
{

View file

@ -135,7 +135,8 @@ namespace ColorTool
return null;
}
return new ColorScheme { colorTable = colorTable, consoleAttributes = new ConsoleAttributes { foreground = fgColor, background = bgColor } };
var consoleAttributes = new ConsoleAttributes { foreground = fgColor, background = bgColor };
return new ColorScheme { colorTable = colorTable, consoleAttributes = consoleAttributes };
}
}
}