public static void AddColor(byte r, byte g, byte b, string colorName, string removeColorWithName) { ConhicsColor conhicsColorToEdit = GetColor(removeColorWithName); colorDictionary.Remove(removeColorWithName); EditColor(conhicsColorToEdit, r, g, b, colorName); colorDictionary.Add(colorName, conhicsColorToEdit); }
private static void EditColor(ConhicsColor conhicsColorToEdit, byte r, byte g, byte b, string colorName) { ConsoleColor consoleColorToEdit = conhicsColorToEdit.ConsoleColor; conhicsColorToEdit.SetColor(r, g, b, colorName); string consoleColorToEditName = Enum.GetName(typeof(ConsoleColor), consoleColorToEdit); object consoleScreenBufferInfoBoxed = consoleScreenBufferInfo; typeof(Integration.CONSOLE_SCREEN_BUFFER_INFO_EX) .GetField(name: consoleColorToEditName) .SetValue(obj: consoleScreenBufferInfoBoxed, value: conhicsColorToEdit.ColorRef); consoleScreenBufferInfo = (Integration.CONSOLE_SCREEN_BUFFER_INFO_EX)consoleScreenBufferInfoBoxed; Integration.SetConsoleScreenBufferInfoEx(Screen.s_handle, ref consoleScreenBufferInfo); }
public static void Print(char character, int x, int y, Color.ConhicsColor conhicsColor) { Print(character, x, y, conhicsColor.ConsoleColor); }