Plus searching this site for SetConsoleTextAttribute will find loads of exisiting examples, inc. console games.
Note that if your console background is not the default black, you will have to use GetConsoleScreenBufferInfo as well as SetConsoleTextAttribute when you set the foreground color, so you do not lose the background color (the character attribute is foreground color plus background color plus -- sometimes -- multi-byte character set attributes.)
PS For those of you who (also) use Linux, if you're distro's terminal implementation supports ANSI escape codes, you can use the same kind of apprroach as this hex view tool: