❔ Best way to convert rgb to ConsoleColor?
Hey, so I have a Console App, where I want to transition between 2 colors( and output the color as backgroundcolor). I have the main code from ChatGPT for test cases, and the RGBToConsoleColor from stackoverflow. However, the transition seems kinda buggy (when transitioning from black to white it goes
black, green, light gray, dark gray, white
). Does anyone know a better/more accurate way to convert rgb values to ConsoleColor?5 Replies
ConsoleColor is only 16 colors iirc? If you want a smoother gradient then you could check out $spectre
Spectre.Console is a .NET library that allows for easy creation of console UIs, text formatting in the console, and command-line argument parsing.
https://spectreconsole.net/
Spectre.Console - Welcome!
Spectre.Console is a .NET library that makes it easier to create beautiful console applications.
Thanks, I'll look into it!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.