GuiSwatchButtonCtrl¶
A button that is used to represent color; often used in correlation with a color picker.
- Inherit:
- GuiButtonBaseCtrl
Description¶
A swatch button is a push button that uses its color field to designate the color drawn over an image, on top of a button.
The color itself is a float value stored inside the GuiSwatchButtonCtrl::color field. The texture path that represents the image underlying the color is stored inside the GuiSwatchButtonCtrl::gridBitmap field. The default value assigned toGuiSwatchButtonCtrl::color is “1 1 1 1”( White ). The default/fallback image assigned to GuiSwatchButtonCtrl::gridBitmap is “tools/gui/images/transp_grid”.
Example:
// Create a GuiSwatchButtonCtrl that calls randomFunction with its current color when clicked
%swatchButton = newGuiSwatchButtonCtrl()
{
profile = "GuiInspectorSwatchButtonProfile";
command = "randomFunction( $ThisControl.color );";
};