How can I print color in console? I want to show data in colors when the processor sends data and in different colors when it receives data.
You could do this using ANSI escape sequences. I've actually put together this class in Java for anyone that would like a simple workaround for this. It allows for more than just color codes.
https://gist.github.com/nathan-fiscaletti/9dc252d30b51df7d710a
(Ported from: https://github.com/nathan-fiscaletti/ansi-util)
Example Use:
StringBuilder sb = new StringBuilder();
System.out.println(
sb.raw("Hello, ")
.underline("John Doe")
.resetUnderline()
.raw(". ")
.raw("This is ")
.color16(StringBuilder.Color16.FG_RED, "red")
.raw(".")
);