First of all, you absolutely
don't need to use P/Invoke. It would kill platform compatibility. You can run the multi-colored console code which would run on many different platforms, such as Linux, Max OS X (for example, via Mono) —
without recompilation. Usually, you can use 16 colors for both font background and foreground
at the same time.
This article explains how. I tried it — it works. Please see:
http://www.dotnetperls.com/console-color[
^].
—SA