diff --git a/crates/color-ui/src/ui/palette.rs b/crates/color-ui/src/ui/palette.rs index db62b23c9..e94ece836 100644 --- a/crates/color-ui/src/ui/palette.rs +++ b/crates/color-ui/src/ui/palette.rs @@ -13,6 +13,9 @@ use std::sync::Arc; #[cfg(feature = "screen-testing")] mod stories; +/// The table's drag mapper, type-erased so the palette needs no payload parameter. +type TableMap<'a> = Arc) -> SwatchTable<'a> + 'a>; + /// What a [`SwatchPalette`] reports. #[derive(Debug)] #[non_exhaustive] @@ -49,38 +52,46 @@ pub struct SwatchPalette<'a> { label: Label, color: Bind<'a, Srgba>, swatches: &'a [(Label, Srgba)], + spacing: SwatchSpacing, + drag: Option>, } impl<'a> SwatchPalette<'a> { /// A palette named `label` of `swatches`, each a name and a colour, choosing the colour bound to `color`. pub fn new(label: impl Into