Bug 495259

Summary: Code colorization intensity is wonky at startup
Product: [Applications] kdevelop Reporter: Matthew Woehlke <mwoehlke.floss>
Component: UI: generalAssignee: kdevelop-bugs-null
Status: REPORTED ---    
Severity: normal CC: igorkuo
Priority: NOR    
Version: 6.0.240802   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: example of incorrect coloring
example of correct coloring

Description Matthew Woehlke 2024-10-23 18:48:47 UTC
SUMMARY
On startup, KDevelop colorization intensity seems to be "maximum" regardless of the configured values.

STEPS TO REPRODUCE
1. Open KDevelop
2. Look at some code that has semantic highlighting (e.g. C++)
3. Open Settings > Configure KDevelop > Language Support
4. Under Semantic Code Highlighting, change the values slightly (e.g. by one "notch") and Apply
5. Change the values to their previous values and Apply

OBSERVED RESULT
Before (4), text is nigh-unreadable (at least in my light-on-dark color scheme; likely this is the case with most light-on-dark color schemes). Upon changing the colorization intensity, colorization of the code in the editor view changes *dramatically* for the better. The second change has (as expected) minimal effect.

EXPECTED RESULT
KDevelop should start with colorization intensity consistent with the saved setting.

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
My configured colorization intensities are pretty low (at a guess, about 15% and 25% for local and global, respectively). I expect this is at least partly necessary for the bug to be evident.
Comment 1 Igor Kushnir 2024-10-24 13:35:59 UTC
Perhaps most people use the default settings or very different light-on-dark schemes and don't notice this issue. If you want to fix it, look for a bug in https://commits.kde.org/kdevelop?path=kdevplatform/language/highlighting/colorcache.cpp . At a guess, either a different color-updating method is used or some data is not initialized/ready at KDevelop start.
Comment 2 Matthew Woehlke 2024-10-28 18:21:16 UTC
It looks like this may only happen with "follow system color scheme". I suspect (but haven't checked because changing the system color scheme is very disruptive for me) Breeze Dark would have problems. I'm using Obsidian Coast (used to be bundled with KF4).
Comment 3 Matthew Woehlke 2024-10-28 18:26:34 UTC
Another update... the problem isn't that the intensity is initially being treated as 100%. The colors are just *wrong*. I now suspect they're being computed (perhaps with the correct intensity) as if the *base* color is black, when it's actually off-white.
Comment 4 Matthew Woehlke 2024-10-28 20:03:17 UTC
Created attachment 175315 [details]
example of incorrect coloring
Comment 5 Matthew Woehlke 2024-10-28 20:04:54 UTC
Created attachment 175316 [details]
example of correct coloring