ui/color_wheel

Types

Messages for color wheel keyboard navigation

pub type Msg {
  Increase
  Decrease
  SetMin
  SetMax
  IncreaseLarge
  DecreaseLarge
}

Constructors

  • Increase
  • Decrease
  • SetMin
  • SetMax
  • IncreaseLarge
  • DecreaseLarge
pub type Size {
  Small
  Medium
  Large
}

Constructors

  • Small
  • Medium
  • Large
pub type Variant {
  Default
  Muted
}

Constructors

  • Default
  • Muted

Values

pub fn color_wheel(
  attributes: List(attribute.Attribute(a)),
  children: List(element.Element(a)),
) -> element.Element(a)
pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)

Keymap for color wheel keyboard navigation

Keyboard interactions:

  • Arrow Right/Up: Increase hue value (rotate clockwise)
  • Arrow Left/Down: Decrease hue value (rotate counter-clockwise)
  • Home: Minimum value (0 degrees - red)
  • End: Maximum value (360 degrees)
  • PageUp: Large increment (+10)
  • PageDown: Large decrement (-10)

Follows WAI-ARIA Slider pattern.

pub fn size(s: Size) -> attribute.Attribute(a)
pub fn thumb(
  attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
Search Document