ColorInput¶
Bases:
pygame_menu.widgets.widget.textinput.TextInput
Color input widget.
Parameters: - label (str) – Input label text
- colorinput_id (str) – ID of the text input
- color_type (str) – Type of color input (rgb, hex)
- input_separator (str) – Divisor between RGB channels
- input_underline (str) – Character drawn under each number input
- cursor_color (tuple) – Color of cursor
- onchange (callable, None) – Callback when changing the selector
- onreturn (callable, None) – Callback when pressing return button
- prev_size (int, float) – Width of the previsualization box in terms of the height of the widget
- repeat_keys_initial_ms (int, float) – Time in ms before keys are repeated when held
- repeat_keys_interval_ms (int, float) – Interval between key press repetition when held
- repeat_mouse_interval_ms (int, float) – Interval between mouse events when held
- kwargs (any) – Optional keyword-arguments for callbacks
Clear the current text.
Returns: None
Draw the widget shape.
Parameters: surface ( pygame.Surface
) – Surface to drawReturns: None
Return the color value as a tuple or red blue and green channels. If the data is invalid the widget returns (-1,-1,-1).
Returns: Color tuple as (R,G,B) Return type: tuple
Update internal variable according to the given events list and fire the callbacks.
Parameters: events (list[ pygame.event.Event
]) – List of pygame eventsReturns: True if updated Return type: bool