I noticed that QPalette had these (see link below), but KColorScheme didn't. Since there is no function to get the number of items in an enum for C++, it seems like it would be useful to have a built-in way to get the total number of color sets or roles. For instance, a person might want to create an array of all foreground colors, but they would have to hardcode the array sizes without this patch.
I also removed some enum item value assignments that don't seem to have any use and might cause issues if new enum items are added.
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/kernel/qpalette.h#n90
I plan to make a follow up patch to reduce the amount of hardcoded values in KColorScheme.