Exemplo n.º 1
0
        def pickColorWithPositioning(self, startingcolor, screenX, screenY):
            from wnd.dlgs.choosecolor import ChooseColor
            global colorDialog
            global customColors

            if colorDialog is None:
                colorDialog = ChooseColor()
            r, g, b = startingcolor[1:3], startingcolor[3:5], startingcolor[5:]
            bgr = int(b + g + r, 16)
            #log.debug("bgr in = %x (%r)", bgr, bgr)
            colorDialog.onINIT = _adjustWindow
            res = colorDialog.Run(None,
                                  'fullopen',
                                  'hook',
                                  customcolors=customColors,
                                  initcolor=bgr)
            if res is not None:
                bgr = "%06x" % res
                #log.debug("bgr out = %r", bgr)
                b, g, r = bgr[:2], bgr[2:4], bgr[4:]
                for i, x in enumerate(colorDialog._dlgs_colors):
                    customColors[i] = int(x)
                return '#' + r + g + b