Ummm... this has been well documented for like 30 years...

Why wouldn't you just include conio.h and use the textcolor() and textbackground() functions?
It's not a standard header but it's...