Module color_swatch
Expand description
Colour swatches: one named swatch type, one painter, one picker.
ColorSwatchis a colour with an optional name; a swatch without a name is spoken and shown as its#RRGGBBhex.ColorSwatchFacepaints a swatch and answers its hit-test, tooltip and radio-style accessibility, for dense toolbars and custom canvases that keep their own layout.ColorSwatchPickeris a grid of swatches as a widget. Clicking a swatch records its index; the host reads it withColorSwatchPicker::take_choice(or is told throughColorSwatchPicker::on_change) and writes the colour to its model.ColorSwatchPicker::with_painterpaints a sample in each cell instead of the flat colour, for a choice among brushes or patterns.super::ColorPicker::with_swatchesuses the same swatches as quick picks beside its full colour field.
Structs§
- Color
Swatch - One colour a person can pick.
- Color
Swatch Face - An immediate-mode swatch: paint, hit-test, tooltip and accessibility from one declaration.
- Color
Swatch Picker - A grid of
ColorSwatches as a widget.
Type Aliases§
- Swatch
Painter - Paints swatch
indexinto its rect in place of its flat colour:(scene, transform, rect, index, theme, text).