public PcmColor(PcmColor color, float alpha) { R = color.R; B = color.B; G = color.G; A = Convert.ToByte(alpha); }
private static void PrintRow(int width, PcmColor color, PcmColor backgroundColor, GameConsoles targetConsole = GameConsoles.Output, params string[] columns) { var columnWidth = (width - columns.Length) / columns.Length; var row = "|"; foreach (var column in columns) { row += AlignCenter(column, columnWidth) + "|"; } WriteLine(row, color, backgroundColor, targetConsole); }
public static void Write(string text, PcmColor color = null, PcmColor backgroundColor = null, GameConsoles targetConsole = GameConsoles.Output) { ConsoleBuffer consoleBuffer; switch (targetConsole) { case GameConsoles.Events: consoleBuffer = potatoChipGame.Events; break; default: consoleBuffer = potatoChipGame.Output; break; } foreach (var c in text) { consoleBuffer.Write(new ConsoleChar(c, color ?? PcmColor.White, backgroundColor ?? PcmColor.Black)); } }
public TableOutput(int width, PcmColor foregroundColor = null, PcmColor backgroundColor = null) { this.width = width; ForegroundColor = foregroundColor ?? PcmColor.Cyan; BackgroundColor = backgroundColor ?? PcmColor.Black; }
private static void PrintLine(int width, PcmColor color, PcmColor backgroundColor, GameConsoles targetConsole = GameConsoles.Output) { WriteLine(new string('-', width), color, backgroundColor, targetConsole); }
public ConsoleChar(char character, PcmColor foregroundColor = null, PcmColor backgroundColor = null) { Char = character; ForegroundColor = foregroundColor ?? PcmColor.White; BackgroundColor = backgroundColor ?? PcmColor.Black; }