Пример #1
0
def show_popup():
    show = P()  # Create a new instance of the P class
    clr_picker = ColorPicker()
    clr_picker.pos_hint = {"x": 0.05, "top": 0.99}
    show.add_widget(clr_picker)

    def on_color(instance, value):
        print("RGBA = ", str(value))  # or instance.color
        global mcolor
        res = tuple(value)
        mcolor = list(map(mul, res, (255, 255, 255, 255)))
        temp = 0
        temp = mcolor[0]
        mcolor[0] = mcolor[2]
        mcolor[2] = temp
        mcolor = tuple(mcolor)

        print(mcolor)

    clr_picker.bind(color=on_color)
    popupWindow = Popup(title="Popup Window",
                        content=show,
                        size_hint=(None, None),
                        size=(600, 600))
    # Create the popup window

    popupWindow.open()  # show the popup