While adding support for active, link, visited, negative, neutral and positive background roles, I noticed that there was an awful lot of tedious copying/pasting and occasionally slight modification involved in that work. That was only with Kirigami and qqc2-desktop-style. Now I'm working on plasma-framework, which has more of the same. I believe KIconThemes is still missing a lot of color scheme colors because there are lots of CSS color scheme classes that work in plasmashell, but not in applications.
Surely there's a better way to handle all of this with minimal duplicated effort while still providing an easy way to use color scheme colors?
QPalette has a color(ColorGroup, ColorRole) function that is easy to use and easy to recreate. Maybe we'd have to copy/paste the ColorSet, ForegroundRole, BackgroundRole and DecorationRole enums from KColorScheme for tier 1 frameworks (or maybe use git submodules?), but that's a lot easier than making tons of functions and function definitions that are only slightly different from each other and just return a single color.
I realize we'd still have to maintain compatibility with existing code, but maybe we can introduce color(ColorSet, *Role) functions and deprecate the old, tedious to make methods for using color scheme colors?
I also realize that framework design is not my area of expertise and I'm interested in what others have to say.