(self, obj, value)
Verifies that 'value' is a string or tuple and converts it to a
        value like 'rgb(x,y,z)'
Verifies that 'value' is a string or tuple and converts it to a
        value like 'rgb(x,y,z)'
Verifies that value is a string or tuple and converts it to a value like rgb ( x y z )
def validate(self, obj, value):
        """
        Verifies that 'value' is a string or tuple and converts it to a
        value like 'rgb(x,y,z)'
        """
        value = super(ColorAlpha, self).validate(obj, value)
        if isinstance(value, tuple):
            if len(value) == 3:
                # convert to an rgb string
                return 'rgb({},{},{})'.format(*value)
            else:
                # convert to an rgba string
                return 'rgba({},{},{},{})'.format(*value)
        else:
            # already a string
            return value
def validate ( self , obj , value ) : value = super ( ColorAlpha , self ) . validate ( obj , value ) if isinstance ( value , tuple ) : if len ( value ) == 3 : # convert to an rgb string return 'rgb({},{},{})' . format ( * value ) else : # convert to an rgba string return 'rgba({},{},{},{})' . format ( * value ) else : # already a string return value