IupColorBrowser

IUP - Portable User Interface

IupColorBrowser

Creates an element for selecting colors from the HLS (Hue Saturation Brightness) model, which allows the user to interactively choose a color.

This is an additional control that depends on the CD library. It is included in the Controls Library.

For a dialog that simply returns the selected color, you can use function IupGetColor.

Creation

Ihandle* IupColorBrowser(void); [in C]
iup.colorbrowser{} (elem: ihandle) [in Lua]
colorbrowser() [in LED]

The function returns the identifier of the created colorbrowser, or NULL if an error occurs.

Attributes

RGB: Contains the color selected in the control, in the “rrr ggg bbb” format; r, g and b are integers ranging from 0 to 255. This value can both be consulted and modified.

Callbacks

DRAG_CB: Called several times while the color is being changed by dragging the mouse over the control.

int drag(Ihandle *self, unsigned char r, unsigned char g, unsigned char b); [in C]
elem:drag_cb(r: number, g: number, b: number) -> (ret: number) [in Lua]

CHANGE_CB: Called when the user releases the left mouse button over the control, defining the selected color.

int change(Ihandle *self, unsigned char r, unsigned char g, unsigned char b); [in C]
elem:change_cb(r: number, g: number, b: number) -> (ret: number) [in Lua]

Examples

Browse Example Files