ColorButton - Garland-g/perl6-libui GitHub Wiki

ColorButton

Libui::ColorButton

A button for selecting a color. Stored as an RGBA quadruple where each number is a num64 in the range 0 to 1.0. The Color module is used to accept a wider variety of input.

Methods

new()

Creates a ColorButton

color() returns Color

Returns the color in the ColorButton as a Color.

set-color(Color $color) or color(Color $color)

Sets the color using the Color.

set-color(*@args, *%hash)

Sets the color by constructing a Color and using it.

raw-color(num64 $r is rw, num64 $g is rw, num64 $b is rw, num64 $a is rw)

Places the R, G, B, and A values into each variable. Only accepts num64.

raw-color($nr is rw where Num ~~ *, $ng is rw where Num ~~ *, $nb is rw where Num ~~ *, $na is rw where Num ~~ *)

Places the R, G, B, and A values into each variable. Accepts any type that accepts a Num.

raw-set-color(num64 $r, num64 $g, num64 $b, num64 $a)

Sets the R, G, B, and A values of the ColorButton.

changed() returns Supply

Returns a Supply. An event is emitted whenever the color is changed.