(self, widget, result)
return (r//256, g//256, b//256), str(result)
Adjust result returned from call to tk_chooseColor.

        Return both an RGB tuple of ints in the range (0, 255) and the
        tk color string in the form #rrggbb.
Adjust result returned from call to tk_chooseColor.
Adjust result returned from call to tk_chooseColor .
def _fixresult(self, widget, result):
        """Adjust result returned from call to tk_chooseColor.

        Return both an RGB tuple of ints in the range (0, 255) and the
        tk color string in the form #rrggbb.
        """
        # Result can be many things: an empty tuple, an empty string, or
        # a _tkinter.Tcl_Obj, so this somewhat weird check handles that.
        if not result or not str(result):
            return None, None  # canceled

        # To simplify application code, the color chooser returns
        # an RGB tuple together with the Tk color string.
        r, g, b = widget.winfo_rgb(result)
        return (r//256, g//256, b//256), str(result)
def _fixresult ( self , widget , result ) : # Result can be many things: an empty tuple, an empty string, or # a _tkinter.Tcl_Obj, so this somewhat weird check handles that. if not result or not str ( result ) : return None , None # canceled # To simplify application code, the color chooser returns # an RGB tuple together with the Tk color string. r , g , b = widget . winfo_rgb ( result ) return ( r // 256 , g // 256 , b // 256 ) , str ( result )