ColorChooserRequest#

class ColorChooserRequest(**properties: Any)#

Superclasses: Object

A request to open a color chooser.

Whenever the user interacts with an <input type=’color’ /> HTML element, WebKit will need to show a dialog to choose a color. For that to happen in a general way, instead of just opening a ColorChooser (which might be not desirable in some cases, which could prefer to use their own color chooser dialog), WebKit will fire the WebView::run-color-chooser signal with a ColorChooserRequest object, which will allow the client application to specify the color to be selected, to inspect the details of the request (e.g. to get initial color) and to cancel the request, in case nothing was selected.

In case the client application does not wish to handle this signal, WebKit will provide a default handler which will asynchronously run a regular GtkColorChooserDialog for the user to interact with.

Methods#

class ColorChooserRequest
cancel() None#

Cancels request and the input element changes to use the initial color.

Cancels request and the input element changes to use the initial color it has before the request started. The signal ColorChooserRequest::finished is emitted to notify that the request has finished.

Added in version 2.8.

finish() None#

Finishes request and the input element keeps the current value of ColorChooserRequest:rgba.

Finishes request and the input element keeps the current value of ColorChooserRequest:rgba. The signal ColorChooserRequest::finished is emitted to notify that the request has finished.

Added in version 2.8.

get_element_rectangle() Rectangle#

Gets the bounding box of the color input element.

Added in version 2.8.

get_rgba() RGBA#

Gets the current RGBA color of request

Added in version 2.8.

set_rgba(rgba: RGBA) None#

Sets the current RGBA color of request

Added in version 2.8.

Parameters:

rgba – a pointer RGBA

Properties#

class ColorChooserRequest
props.rgba: RGBA#

The type of the None singleton.

Added in version 2.8.

Signals#

class ColorChooserRequest.signals
finished() None#

The type of the None singleton.

Added in version 2.8.