def SetConsoleColor(color: int) -> bool:
global _ConsoleOutputHandle<EOL>global _DefaultConsoleColor<EOL>if not _DefaultConsoleColor:<EOL><INDENT>if not _ConsoleOutputHandle:<EOL><INDENT>_ConsoleOutputHandle = ctypes.windll.kernel32.GetStdHandle(_StdOutputHandle)<EOL><DEDENT>bufferInfo = ConsoleScreenBufferInfo()<EOL>ctypes.windll.kernel32.GetConsoleScreenBufferInfo(_ConsoleOutputHandle, ctypes.byref(bufferInfo))<EOL>_DefaultConsoleColor = int(bufferInfo.wAttributes & <NUM_LIT>)<EOL><DEDENT>if sys.stdout:<EOL><INDENT>sys.stdout.flush()<EOL><DEDENT>bool(ctypes.windll.kernel32.SetConsoleTextAttribute(_ConsoleOutputHandle, color))<EOL>
Change the text color on console window.
color: int, a value in class `ConsoleColor`.
Return bool, True if succeed otherwise False.