col = AllocConsoleColor(color)
color
for the current console and
returns it. You can then make it the active color by passing it to functions like
SetConsoleColor(). Color allocation is necessary because by default only a
few predefined ANSI colors like #BLACK
, #WHITE
, #RED
, etc. are available. If you
want to use custom colors, you need to allocate them first.
When you're done with a color allocated by this function, call FreeConsoleColor() to a free the color. This is important to make sure that you don't run out of colors.
You must enable advanced console mode using EnableAdvancedConsole() before you can use this function. See EnableAdvancedConsole for details.
EnableAdvancedConsole() SetConsoleColor(1, AllocConsoleColor($FFA500)) ConsolePrint("Hello World") RefreshConsole()The code above prints the string "Hello World" in orange. Note that under normal circumstances you should free the console color when you're done with it. This part has been left out for readability reasons.