@@ -64,13 +64,13 @@ def set_value(self, value):
6464 self .value_changed .emit (self .toolTip (), value )
6565
6666
67- class PropColorPickerRGBA (BaseProperty ):
67+ class PropColorPickerRGBA (PropColorPickerRGB ):
6868 """
6969 Color4 (rgba) picker widget for a node property.
7070 """
7171
7272 def __init__ (self , parent = None ):
73- super ( PropColorPickerRGBA , self ) .__init__ (parent )
73+ BaseProperty .__init__ (self , parent )
7474 self ._color = (0 , 0 , 0 , 255 )
7575 self ._button = QtWidgets .QPushButton ()
7676 self ._vector = PropVector4 ()
@@ -85,22 +85,6 @@ def __init__(self, parent=None):
8585 layout .addWidget (self ._button , 0 , QtCore .Qt .AlignLeft )
8686 layout .addWidget (self ._vector , 1 , QtCore .Qt .AlignLeft )
8787
88- def _on_vector_changed (self , _ , value ):
89- self ._color = tuple (value )
90- self ._update_color ()
91- self .value_changed .emit (self .toolTip (), value )
92-
93- def _on_select_color (self ):
94- current_color = QtGui .QColor (* self .get_value ())
95- alpha_option = QtWidgets .QColorDialog .ShowAlphaChannel
96- color = QtWidgets .QColorDialog .getColor (
97- current_color , self , options = alpha_option )
98- if color .isValid ():
99- self .set_value (color .getRgb ())
100-
101- def _update_vector (self ):
102- self ._vector .set_value (self ._color )
103-
10488 def _update_color (self ):
10589 c = [int (max (min (i , 255 ), 0 )) for i in self ._color ]
10690 hex_color = '#{0:02x}{1:02x}{2:02x}{3:03x}' .format (* c )
@@ -116,10 +100,3 @@ def _update_color(self):
116100
117101 def get_value (self ):
118102 return self ._color [:4 ]
119-
120- def set_value (self , value ):
121- if value != self .get_value ():
122- self ._color = value
123- self ._update_color ()
124- self ._update_vector ()
125- self .value_changed .emit (self .toolTip (), value )
0 commit comments