ColourPicker

com.alecdorrington.laminarcomponents.ColourPicker
object ColourPicker

A swatch opening a popover that chooses a colour from given swatches, by shade and hue, or by its #rrggbb code. The popover is position: fixed and placed again beside its swatch on every scroll, so that a scrolling list cannot clip it. A colour is chosen only once a gesture settles (a drag let go), never mid-drag, so that choosing may ask a question or save.

Drawn as .lc-colour-picker, its swatch .lc-colour-swatch, and its popover .lc-colour-popover, holding the .lc-colour-presets (.lc-colour-preset), the .lc-colour-field of shades (its thumb .lc-colour-field-thumb), the .lc-colour-hue slider and the .lc-colour-code field.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Labels(colour: String, shade: String, hue: String)

What a colour picker's controls are called, as screen readers say.

What a colour picker's controls are called, as screen readers say.

Value parameters

colour

The swatch, the popover and its code field, as "Colour".

hue

The hue slider, as "Hue".

shade

The field of shades, as "Shade".

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def apply(colour: Signal[String], choose: String => Unit, swatches: Seq[String], labels: Labels): L.HtmlElement

Renders a colour picker.

Renders a colour picker.

Value parameters

choose

The callback given each newly chosen #rrggbb code, never the colour already chosen.

colour

The #rrggbb code of the colour chosen.

labels

What its controls are called.

swatches

The #rrggbb codes offered first, in order.

Attributes

Returns

The picker.