I have this little program I made that randomly plays audio files. Does anyone know the easiest way to display a full-screen hex background color in the terminal for each sound file that plays? I want a specific background color attached to each file, so that the color is displayed every time the file plays. I want the terminal just one solid color, no text or anything else.
But you might be able to synthesis some other colours by dithering f/g and b/g with https://en.wikipedia.org/wiki/Block_Elements
U+2591 ░ Light shade
U+2592 ▒ Medium shade
U+2593 ▓ Dark shade
IMO it might be easier to create a bare-bones Win32 API window, changing the client area's background color is easy vs. doing it in a command prompt console window.
Especially since your app isn't taking any input from the user. Just launch and listen.
@Furry Guy Okay, I will try that. But how do I assign each color to an audio file? Would I do that with a loop of some kind? Like, if g3.wav then background color is #FF0000 or something like that?
Okay, I will try that. But how do I assign each color to an audio file? Would I do that with a loop of some kind? Like, if g3.wav then background color is #FF0000 or something like that?
If you want the assignment of colour to file to be done inside your C++ code, I'd use a std::map, using the filenames as keys, as the colours as values. Then, then you display a particular filename, you can easily obtain the appropriate colour from the map.