fsleyes_widgets.colourbutton
¶
This module provides the ColourButton
class, a button which
allows the user to select a RGBA colour.
Bases:
wx._core.Button
A
wx.Button
which allows the user to select a colour.The currently selected colour is displayed as a bitmap on the button. When the user presses the button, a
wx.ColourDialog
is displayed, allowing the user to change the colour. When the user does so, aEVT_COLOUR_BUTTON_EVENT
is generated.This class provides an alternative to the
wx.ColourPickerCtrl
, which is a bit inflexible w.r.t. sizing/automatic resizing.Create a
ColourButton
.- Parameters
parent – A
wx
parent window.size – A tuple containing the
(width, height)
of the colour bitmap in pixels. Defaults to(32, 32)
.colour – Initial colour. Defaults to black.
Return the current colour, as a tuple of
(r, g, b, a)
values, each in the range[0 - 255]
.
Sets the current colour to the specified
colour
.
Identifier for the
ColourButtonEvent
.
alias of
wx.lib.newevent.NewEvent.<locals>._Event