How does Papermc print colors to console window?

This is unrelated to minecraft at all. How does Papermc print colors to the console window? I’m working on a small Java application and would like to do this, though I’ve only been able to print colors to a unix based terminal, not to a windows one.