tawasuyu

tawasuyu/llimphi

Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.

Rust 660Markdown 302TOML 157RON 312382 Definitions

⎇ main widgets/color-picker/README.md Markdown · 27 lines · 745 B History raw

chore: refresco desde el monorepo — 27 crates nuevos (anim, lottie, svg, mesh, image, layer, test, wire-view, widgets rag-sidebar/router/lazy-list/rive-button) y sync de los 95 existentes 93253cc22 · Sergio ·

1# llimphi-widget-color-picker
2
3Agnostic RGBA colour picker.
4
5It composes three pieces, top to bottom:
6
71. a **swatch** of the current colour,
82. a **palette of preset chips** (a click sets the RGB while keeping the current
9   alpha), wrapped if it does not fit in one row,
103. four **RGBA sliders** for fine adjustment.
11
12It is agnostic: it knows nothing about config or `FieldValue`. It takes the
13colour as `[u8; 4]` and emits the new one through `on_change([u8; 4]) -> Msg`.
14Any llimphi app uses it by passing its own `Msg`.
15
16```ignore
17color_picker_view(
18    self.border,
19    DEFAULT_SWATCHES,
20    &ColorPickerPalette::from_theme(&theme),
21    |rgba| Msg::SetBorderColor(rgba),
22)
23```
24
25---
26
27Part of **llimphi** — see [llimphi](../../README.md).

README.md

llimphi-widget-color-picker

Agnostic RGBA colour picker.

It composes three pieces, top to bottom:

  1. a swatch of the current colour,
  2. a palette of preset chips (a click sets the RGB while keeping the current alpha), wrapped if it does not fit in one row,
  3. four RGBA sliders for fine adjustment.

It is agnostic: it knows nothing about config or FieldValue. It takes the colour as [u8; 4] and emits the new one through on_change([u8; 4]) -> Msg. Any llimphi app uses it by passing its own Msg.

color_picker_view(
    self.border,
    DEFAULT_SWATCHES,
    &ColorPickerPalette::from_theme(&theme),
    |rgba| Msg::SetBorderColor(rgba),
)

Part of llimphi — see llimphi.