How to change the color picker?


bpy.types.UILayout.template_color_picker()
Can I somehow change the panel or is it outside the scope of the blender api?
I know that you can create your own color picker panel, but it will not work everywhere.

What do you mean exactly by changing the color picker? Is it the mode of the picker (HSV and what not), or the actual color? Or maybe something different?

I would like to add my own buttons, specifically the color palette, but I don’t know how to access this menu.

I’m not aware of that bring exposed in the Python code, nor if it should be…
I think you’ll have better luck editing the source code, but I’m not fully sure if I’m 100% correct on this!

Actually it is… see this:

https://docs.blender.org/api/current/bpy.props.html?highlight=floatvectorproperty#bpy.props.FloatVectorProperty

Write something like this in you code to define the property:

pdt_colour = FloatVectorProperty(name='Colour',subtype='COLOR',default=(0.5,0.5,0.9))

Note the subtype. Call it like this in a menu:

row.prop(scene, 'pdt_colour', text='Colour')

It looks like this in the menu:

25

And this when you click on the Coloured Box:

47

Cheers, Clock. :cocktail::grin:

1 Like

Wonderful, even better!

1 Like

Also @mac7ua, I forgot to say this, if you want the alpha as well, do this:

pdt_colour = FloatVectorProperty(name='Colour',subtype='COLOR_GAMMA',size=4,default=(0.5,0.5,0.9,1.0))

To get this:

20

Cheers, Clock. :cocktail:

EDIT:

This used gamma corrected colour as an alternative…

1 Like

No, I want to do it. I think this is implemented outside of python.
2

Sorry I cannot help you any more, I know of no method to re-create this using the API and Python.