Version

Quick search

Color Picker

New in version 1.7.0.

Warning

This widget is experimental. Its use and API can change at any time until this warning is removed.

_images/colorpicker.png

The ColorPicker widget allows a user to select a color from a chromatic wheel where pinch and zoom can be used to change the wheel’s saturation. Sliders and TextInputs are also provided for entering the RGBA/HSV/HEX values directly.

Usage:

clr_picker = ColorPicker()
parent.add_widget(clr_picker)

# To monitor changes, we can bind to color property changes
def on_color(instance, value):
    print("RGBA = ", str(value))  #  or instance.color
    print("HSV = ", str(instance.hsv))
    print("HEX = ", str(instance.hex_color))

clr_picker.bind(color=on_color)
class kivy.uix.colorpicker.ColorPicker(**kwargs)

Bases: kivy.uix.relativelayout.RelativeLayout

See module documentation.

class kivy.uix.colorpicker.ColorWheel(**kwargs)

Bases: kivy.uix.widget.Widget

Chromatic wheel for the ColorPicker.

Changed in version 1.7.1: font_size, font_name and foreground_color have been removed. The sizing is now the same as others widget, based on ‘sp’. Orientation is also automatically determined according to the width/height ratio.

on_touch_down(touch)

Receive a touch down event.

Parameters:
touch: MotionEvent class

Touch received. The touch is in parent coordinates. See relativelayout for a discussion on coordinate systems.

Returns:

bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.

on_touch_move(touch)

Receive a touch move event. The touch is in parent coordinates.

See on_touch_down() for more information.

on_touch_up(touch)

Receive a touch up event. The touch is in parent coordinates.

See on_touch_down() for more information.