1

I'm currently using ANSI escape sequences for setting text color, but with big buffer sizes it's becoming too costly, so I am seeking for faster solutions, possibly applying colors directly.

I tried modifying CONSOLE_SCREEN_BUFFER_INFOEX structure to set desired colors, but once I change one, text written previously changes its color as well, thus I am limited to 16 colors.

Exceeding limit by using ANSI escape sequences

In the image shown, I printed 60 different colors using ANSI escape sequences, so it proves that there is a way of exceeding this limit.

Don't know whether there is a need of specifying this, since it's more a WinApi related question, but I'm writing my project in C#.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Ghost XYZ
  • 11
  • 1
  • 1
    @RobertHarvey Which of those proposed duplicates answers this question? They all seem to either suggest to use Virtual Terminal Sequences, or use the Console API (which is limited to 16 different colors at any given time). Unless I overlooked something. – IInspectable Aug 02 '20 at 22:36

0 Answers0