Hello there,
It seems that it’s been asked a few times on the internet, but it never got any satisfying answer.
I am trying to pick a color in the viewport, I used to use bgl.glReadPixels but it seems it’s been deprecated in 2.91 in some way, it only returns black in my case and I was not able to find a workaround.
The Color widget picker on the other hand seems to be the perfect tool for the job. However I hit two issues:
- I don’t want the color widget, I just want the color picker. bpy.ops.ui.eyedropper_color() in my own operator only returns {‘PASS_THROUGH’}.
- Let’s say I accept to use a color property in the UI, I still want to run some functions before running the picker, which is not possible AFAIK? The set or update functions only happen after I finished picking.
If anyone has an idea how to add a simple color picker, I’d appreciate the help!