Made some progress but not satisfied with it because it is not done from the top level.
Create a Prolog source code file, e.g. message_property_test.pl
:- multifile
user:message_property/2.
user:message_property(warning, color(fg(blue))).
test :-
print_message(warning,'here').
Start top level
Welcome to SWI-Prolog (threaded, 64 bits, version 8.0.0)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?-
One upon a time terminals were black with green characters. Then they got mostly white as this was supposed to be easier to read, something to which I fully agree. Now they seem to turn black again. I guess that is called innovation
Anyway, SWI-Prolog’s color palettes are designed for light backgrounds. The ones for PceEmacs are still fairly easy to modify AFAIK, but the ones for the terminal are hard coded and can only be disabled. What should happen is that the code should use symbolic names and an additional table should translate this to physical colors. As @EricGT points out this is already the case for print_message/2 based on the level argument (thanks, forgot about that). Still, boot/messages.pl uses direct ansi color names for e.g., false, etc.
That all is not that hard. There is one harder problem: find the current foreground and (notably) background color of the console. There is an ansi sequence to ask the terminal, but then you have to be aware that the reply may appear just about anywhere in the input due to delays and filled buffers.
If someone wants to sort it out, I’m more than happy to review and merge. A first attempt could or course demand the user to select the color theme in swipl.ini/.swiplrc
Ah so I tried that, white on black. Works great. Until the next line of the script runs Visual Studio build, which dumps warnings in Yellow.
For what it’s worth, there is NO option to configure this in MSBuild, but Powershell has an ability to piping the output and recolor the text, so my problem is resolved.