The answer by @Kuba changing color of error messages did not seem to work for me (MMA 11.0.1 Win 10 64-bit).
I couldn't work out why and implemented something else that does work for me, but it seems very ugly and I'm sure I could learn much by seeing how others would improve on it.
I think @Kuba's answer should have worked because I created the Default.nb as proposed in $UserBaseDirectory and my stylesheets ultimately inherit from it (Default.nb -> JM Stylsheet -> JM Clearer for TeamViewer).
However, I also directly modified my own stylesheets by using the "enter a style name" box, entering MessageMenuLabel and MessageText and styling them appropriately. The new styles worked and I saved stylesheets but on restarting MMA these styles were gone again.
Finally I wrote this (my 1st attempt to programmatically manipulate style definitions) making further use of @Kuba's answer to this question as follows
(* To preserve the current stylesheet information it has to be
plucked out of the StyleDefinitions; 1st time this is OK as the
StyleDefinitions = just a notebook name, but after adding items it
gets messy and we need to extract the stylesheet notebook name to reapply it.
*)
sdef = CurrentValue[EvaluationNotebook[], StyleDefinitions];
If[! StringQ[sdef], (*
this is typically just the filename of a stylesheet notebook,
but if it isn't... *)
sdef = ToString[sdef];
sdef = StringCases[sdef, "StyleDefinitions -> " ~~ __ ~~ ".nb]]",
1];
sdef = StringReplace[
sdef[[1]], {"StyleDefinitions -> " -> "", "]]" -> ""}]
];
SetOptions[EvaluationNotebook[], StyleDefinitions -> Notebook[{
Cell[StyleData[StyleDefinitions -> sdef]],
Cell[StyleData["MessageMenuLabel"], Bold,
FontColor -> RGBColor[N[174/255], 0.1, 0],
FontSize ->
CurrentValue[{StyleDefinitions, "Output", "FontSize"}]],
Cell[StyleData["MessageText"],
FontColor -> RGBColor[0.1, 0.1, 0.1]]
}
]
(* last line needed per Kuba's Programming scripts to create and modify stylesheets answer*)
/. s_Symbol /; Context[s] === "Global`" :>
Symbol["FrontEnd`" <> SymbolName[s]]]
(* Do something illegal to check the message appearance... *)
1/0
Questions Why might the straightforward approach not have worked, and - for educational purposes - how should it be done programmatically & idiomatically?
PacletSymbol["Wolfram/StylesheetTools", "StylesheetReplaceAll"]
can be used.) I was going to propose to you to make a paclet (and submit it.) $\endgroup$