Change color text in QuPath console

Hi Pete and QuPath developpers !

This question might have been already asked here or somewhere else but I didn’t find it, if so I apologize…

I would like to print some text within the QuPath console in a different color to highlight the steps of analysis and inform users of my scripts (who are not familiar to QuPath) on what have been executed by QuPath.
I think it is feasable as warning and error messages are printed in orange and red respectively.
I am using 0.2.2 Qupath version.

I found some tricks on the web about Ansi color but I can’t import.
Another thing I expected to work:


…but unfortunatelly it failed…

Thank you all for your help and for developping QuPath !

Regards,

Valentin
Histology Assistant Professor
Anti-Cancer Center Georges-François Leclerc
Dijon, France

1 Like

Hi @Val, by console do you mean

  • the console at the bottom of the script editor
  • View → Show log
  • the console/command prompt in Windows / terminal on Mac?

?

(No matter which one you mean, I don’t know the answer currently… setting text colors could be difficult for all the options :slight_smile: )

Hi Pete, hope you’re doing well! Thx for replying!

Yes I mean the console at the bottom of the script editor.
When using tricks in the linked I shared in my previous message with char27 to acess Ansi Colors

a = new String((char) 27)
print a

returns me a shape of square

Ah, I’m afraid QuPath is using a non-standard component for that via RichTextFX, because JavaFX doesn’t have something similar built-in. Formatting is tricky, and the ERROR/WARN coloring is hard-coded into QuPath (and even then I find it doesn’t always work):

I’m afraid I don’t know of any way to set the colors generally in that component without having to change QuPath itself.

OK Pete. I will keep the default color it is not a problem.
Could this coloring option might be added on a later version ?
Importing new things such as below could be an easiest way ?