public static bool SetForeGroundColour( ForeGroundColour foreGroundColour, bool brightColours) { IntPtr nConsole = GetStdHandle(STD_OUTPUT_HANDLE); int colourMap; if (brightColours) colourMap = (int)foreGroundColour | (int)ForeGroundColour.White; else colourMap = (int)foreGroundColour; return SetConsoleTextAttribute(nConsole, colourMap); }
public static bool SetForeGroundColour( ForeGroundColour foreGroundColour, bool brightColours) { // get the current console handle IntPtr nConsole = GetStdHandle(STD_OUTPUT_HANDLE); int colourMap; // if we want bright colours OR it with white if (brightColours) colourMap = (int) foreGroundColour | (int) ForeGroundColour.White; else colourMap = (int) foreGroundColour; // call the api and return the result return SetConsoleTextAttribute(nConsole, colourMap); }
public static bool SetForeGroundColour( ForeGroundColour foreGroundColour, bool brightColours) { // get the current console handle IntPtr nConsole = GetStdHandle(STD_OUTPUT_HANDLE); int colourMap; // if we want bright colours OR it with white if (brightColours) { colourMap = (int)foreGroundColour | (int)ForeGroundColour.White; } else { colourMap = (int)foreGroundColour; } // call the api and return the result return(SetConsoleTextAttribute(nConsole, colourMap)); }
public static bool SetForeGroundColour( ForeGroundColour foreGroundColour) { // default to a bright white-grey return SetForeGroundColour(foreGroundColour, true); }
public static bool SetForeGroundColour( ForeGroundColour foreGroundColour) { // default to a bright white-grey return(SetForeGroundColour(foreGroundColour, true)); }
public static bool SetForeGroundColour( ForeGroundColour foreGroundColour) { return SetForeGroundColour(foreGroundColour, true); }