Adding color picker?

I wish to add a color picker in the 3D view toolbar panel that doesn’t change any colors on anything, I just wanna save the values from it to a variable.

How do I do this and how should I had figured this out?

Thanks,

GB

I just go here http://paletton.com
you can sought out all compatible colours as well.
It’s way more than just a simple colour picker.

do something like:
bpy.types.Scene.my_color = bpy.props.FloatVectorProperty(subtype=‘COLOR’)
then in the panel class:
row.prop(context.scene, “my_color”)

I wanna add a color picker in blender for a reason… :wink: I’m gonna use it in a script I’m coding.

do something like:
bpy.types.Scene.my_color = bpy.props.FloatVectorProperty(subtype=‘COLOR’)
then in the panel class:
row.prop(context.scene, “my_color”)

Thanks! Just what I was looking for, though you need to set the ‘min’ and ‘max’ parameters as well for it to work properly (else, changing the Value of the color gets really buggy).

Thanks a lot! :slight_smile:

yep, min=0 and max=1 should make it work properly. If you want alpha channel, pass … size=4 … and subtype=‘COLOR_GAMMA’ if you want gamma-correction.

1 Like

Thanks for that! I was wondering what was going on with my addon color picker. Was getting wrong values, but I figured it might be gamma or something. That COLOR_GAMMA did it.