Added check if screen or popup colors were not found.

This commit is contained in:
Patrick Kranz 2019-03-29 21:53:50 +01:00
parent 99f71a0cc5
commit b38f6ffbd1

View file

@ -123,16 +123,22 @@ namespace ColorTool
{
var forgroundIndex = (COLOR_NAMES as IList<string>).IndexOf(forground);
var backgroundIndex = (COLOR_NAMES as IList<string>).IndexOf(background);
popupForgroundColor = colorTable[forgroundIndex];
popupBackgroundColor = colorTable[backgroundIndex];
if (forgroundIndex != -1 && backgroundIndex != -1)
{
popupForgroundColor = colorTable[forgroundIndex];
popupBackgroundColor = colorTable[backgroundIndex];
}
}
if (ReadAttributes("screen", out forground, out background))
{
var forgroundIndex = (COLOR_NAMES as IList<string>).IndexOf(forground);
var backgroundIndex = (COLOR_NAMES as IList<string>).IndexOf(background);
forgroundColor = colorTable[forgroundIndex];
backgroundColor = colorTable[backgroundIndex];
if (forgroundIndex != -1 && backgroundIndex != -1)
{
forgroundColor = colorTable[forgroundIndex];
backgroundColor = colorTable[backgroundIndex];
}
}
}
catch (Exception /*e*/)