src/jmLightToolkit.py
def openMayaColorPicker(self):
        """ Open Maya UI Color Picker. """
        save_color = self.color_picked
        cursor_position = QtGui.QCursor.pos()

        # Pick color
        self.color_picked = pm.cmds.colorEditor(mini=True, rgb=save_color, pos=(cursor_position.x(), cursor_position.y()))
        self.color_picked = [color for color in self.color_picked.split(" ") if color]
        self.color_picked = [float(color) for color in self.color_picked]
        self.color_picked = self.color_picked[:-1]

        if not self.color_picked[0] and not self.color_picked[1] and not self.color_picked[2]:
            self.color_picked = save_color

        color_R = self.color_picked[0] * 255.0
        color_G = self.color_picked[1] * 255.0
        color_B = self.color_picked[2] * 255.0
        color = "{0}, {1}, {2}".format(color_R, color_G, color_B)

        self.pushButton_colorPicker.setStyleSheet("QPushButton{background-color:rgb(%s);}" % color)
        _logger.info("R=%s G=%s B=%s" % (self.color_picked[0], self.color_picked[1], self.color_picked[2]))
        return self.color_picked
 Open Maya UI Color Picker. 
Open Maya UI Color Picker.
Open Maya UI Color Picker .
def openMayaColorPicker(self):
        save_color = self.color_picked
        cursor_position = QtGui.QCursor.pos()
        self.color_picked = pm.cmds.colorEditor(mini=True, rgb=save_color, pos=(cursor_position.x(), cursor_position.y()))
        self.color_picked = [color for color in self.color_picked.split(" ") if color]
        self.color_picked = [float(color) for color in self.color_picked]
        self.color_picked = self.color_picked[:-1]
        if not self.color_picked[0] and not self.color_picked[1] and not self.color_picked[2]:
            self.color_picked = save_color
        color_R = self.color_picked[0] * 255.0
        color_G = self.color_picked[1] * 255.0
        color_B = self.color_picked[2] * 255.0
        color = "{0}, {1}, {2}".format(color_R, color_G, color_B)
        self.pushButton_colorPicker.setStyleSheet("QPushButton{background-color:rgb(%s);}" % color)
        _logger.info("R=%s G=%s B=%s" % (self.color_picked[0], self.color_picked[1], self.color_picked[2]))
        return self.color_picked
def openMayaColorPicker ( self ) : save_color = self . color_picked cursor_position = QtGui . QCursor . pos ( ) self . color_picked = pm . cmds . colorEditor ( mini = True , rgb = save_color , pos = ( cursor_position . x ( ) , cursor_position . y ( ) ) ) self . color_picked = [ color for color in self . color_picked . split ( " " ) if color ] self . color_picked = [ float ( color ) for color in self . color_picked ] self . color_picked = self . color_picked [ : - 1 ] if not self . color_picked [ 0 ] and not self . color_picked [ 1 ] and not self . color_picked [ 2 ] : self . color_picked = save_color color_R = self . color_picked [ 0 ] * 255.0 color_G = self . color_picked [ 1 ] * 255.0 color_B = self . color_picked [ 2 ] * 255.0 color = "{0}, {1}, {2}" . format ( color_R , color_G , color_B ) self . pushButton_colorPicker . setStyleSheet ( "QPushButton{background-color:rgb(%s);}" % color ) _logger . info ( "R=%s G=%s B=%s" % ( self . color_picked [ 0 ] , self . color_picked [ 1 ] , self . color_picked [ 2 ] ) ) return self . color_picked
Open Maya UI Color Picker.
Open Maya UI Color Picker .
""" Open Maya UI Color Picker. """ # Pick color
self