Added check if screen or popup colors were not found.
This commit is contained in:
parent
99f71a0cc5
commit
b38f6ffbd1
|
@ -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*/)
|
||||
|
|
Loading…
Reference in a new issue