I was thinking about if I could implement a similar behavior to this one
as a Krita Python plug-in. However, I couldn’t find a brush stroke event I could connect to and even if I could it seems to me that there is no way to invoke a tool like the color picker at a specific place of the image.
What I basically wanted to do is to hook onto the brush stroke event and invoke the color picker just before the stroke is happening to sample the current color at that coordinate, so it will be used as a foreground color for the next stroke.
fun on_brush_stoke(self, args): color_picker.invoke(args.coordinates) super().on_brush_stroke(args)
I wonder if what I try to do is even possible. From what I can see from the docs, it doesn’t seem to go that deep and is pretty spare with signals/events.
EDIT: The more I look into the API documentation the more I think that it’s not possible to implement this as a python plug-in. I played around with the API and can do all sort of things but not connecting to such low level events like when a tool is used, and overwrite the default behaviour. Maybe I’m just not seeing it. If someone knows more about this, I would appreciate any advice on this.