ColorPickerActivity
ColorPickerWidget as a pushable page.
| Inherits | octomy::activity::PageActivity |
Declared in src/libs/libwidgets/activities/ColorPickerActivity.hpp.
Detailed description
The presentation for hosts that have an activity stack — paint, and anything else that already pushes pickers this way.
⚠ THE PICKER ITSELF IS NOT HERE. This class is a frame: it hands the widget its starting colour, gives it Pick/Cancel, and returns the result through the stack. ColorPickerDialog is the same widget in a modal frame, for the surfaces that have no stack to push onto — a settings row lives in a tool dialog or a docked panel and cannot reach one.
Two frames, one picker. A second implementation would have to be kept in agreement with this one forever, which is the trade §XM-0 already ruled on for the viewport.
Protocol
Push with an optional starting colour:
push("ColorPickerActivity", {"current=#3366ff"});
The chosen colour comes back to the caller's popImpl as:
color=#RRGGBB
Cancel returns no `color=` argument at all, so a host that only looks for the key treats cancel as "nothing happened" without needing a second flag.
With `alpha=1` the picker edits alpha too: `current=` takes `#RRGGBBAA`, and the colour comes back as `color=#RRGGBBAA`, alpha last, as a gradient stop of a material record writes it (rendering-revamp §RVM-9).
Lives at global scope: the Activity stack identifies activities by staticMetaObject.className(), and the rest of the registry uses unqualified names.