Some colors used for highlighting coming from KSyntaxHighlighting::Repository::defaultTheme() seem to depend on the currently active UI color theme. This is not documented, and this variance comes at surprise of e.g. printing to paper or rendering into PDF & Co, where the colors then depend on the current system's UI. Having a default theme adapting to the UI color theme surely also has its uses though, for highlighting of text integrated in UI (messages etc.). So an additional explicit default theme adapting to the current UI theme would make sense, next to bright & dark stable color themes.
@Friedrich: This should not be the case. However, "some colors" is too vague, could you be more precise? What highlighting file? What code example? What theme? The colors are defined in frameworks/syntax-highlighting/data/themes/*.theme. Could it be the case that you are using xml highlighting files that have hard-coded colors?
This was filed in the context of https://phabricator.kde.org/D20766#454924 so I forgot to add more details here, will see to do ASAP. Then as said in that review comment, could also be the symptom is due to a potential bug 406821.
Git commit bbc465981bd55ca5449f5d22e972fccbe994e24f by Dominik Haumann. Committed on 22/05/2019 at 20:09. Pushed by dhaumann into branch 'master'. SyntaxHighlighter: Fix foreground color for text without special highlighting Summary: QTextDocument seems to use the widget palette (or application palette) when drawing text. That is, by default the palette's foreground color is used when no special QTextCharFormat is specified. This patch changes applyFormat() such that the foreground color is always set to avoid the fallback to the QPalette's foreground color. Related: bug 406821 FIXED-IN: 5.59 Test Plan: make && make test + manual testing with the codeeditor example Reviewers: vkrause, cullmann, kossebau Reviewed By: cullmann Subscribers: kwrite-devel, kde-frameworks-devel Tags: #kate, #frameworks Differential Revision: https://phabricator.kde.org/D21295 M +0 -1 examples/codeeditor/codeeditor.cpp M +4 -4 src/lib/syntaxhighlighter.cpp https://commits.kde.org/syntax-highlighting/bbc465981bd55ca5449f5d22e972fccbe994e24f