diff --git a/reactos/subsys/system/cmd/color.c b/reactos/subsys/system/cmd/color.c index a5fbc5f22c2..9150bc8b38f 100644 --- a/reactos/subsys/system/cmd/color.c +++ b/reactos/subsys/system/cmd/color.c @@ -1,4 +1,4 @@ -/* $Id: color.c,v 1.3 2003/08/07 09:27:42 hbirr Exp $ +/* $Id: color.c,v 1.4 2004/02/19 17:04:11 gvg Exp $ * * COLOR.C - color internal command. * @@ -68,19 +68,26 @@ VOID SetScreenColor (WORD wColor, BOOL bFill) CONSOLE_SCREEN_BUFFER_INFO csbi; COORD coPos; - if (bFill == TRUE) + if ((wColor & 0xF) == (wColor &0xF0) >> 4) { - GetConsoleScreenBufferInfo (hConsole, &csbi); + ConErrPuts (_T("Same colors error! (Background and foreground can't be the same color)")); + } + else + { + if (bFill == TRUE) + { + GetConsoleScreenBufferInfo (hConsole, &csbi); - coPos.X = 0; - coPos.Y = 0; - FillConsoleOutputAttribute (hConsole, + coPos.X = 0; + coPos.Y = 0; + FillConsoleOutputAttribute (hConsole, (WORD)(wColor & 0x00FF), (csbi.dwSize.X)*(csbi.dwSize.Y), coPos, &dwWritten); - } - SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF)); + } + SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF)); + } }