KWin needs to provide a way to interactively pick the color and provide it back to the calling application.
This could be implemented similar to screenshot by using a dedicated kwin effect which provides a dedicated dbus interface. When invoked the effect turns into a fullscreen effect, grabs pointer (and touch) events and performs the interaction. Once a color is selected it is sent as a DBus reply to the calling application.