Share the colour editor, add an eyedropper, use library code

- ColorEditor: the HSB / RGB / field editor and hex box, now shared by
  the Select Color panel and the Options background swatches. Those
  swatches open the panel without tabs or index colours, which removes
  the iced_aw color_picker feature and the BgPicker messages.
- Sliders are iced's built-in slider and vertical_slider over a
  gradient container; the custom GradientSlider widget is gone.
- Nearest index colour comes from opencadcodec's aci_table::nearest_aci.
- Eyedropper: a pipette at the right of the mode row hides the panel,
  captures the window with iced's screenshot task and shows an 11x11
  magnifier beside a crosshair; a click picks the pixel, Esc backs out.
  Not offered on the web build.
- The hex box applies six-digit values while typing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
Claude committed 2026-10-12 17:56:52 +00:00
1 parent 3d7db54c23
commit cefa258823
16 files changed
+1125 -1053

No files matched your search

+5
View File
@@ -2475,6 +2475,11 @@ bg={bg_ms:.1}ms n={view_count}"
}
if let Some(picker) = self.color_picker.as_ref() {
// While the eyedropper is picking, the panel steps aside so the
// whole window can be sampled.
if let Some(eyedropper) = picker.eyedropper_view() {
return iced::widget::stack![base, eyedropper].into();
}
crate::ui::modal::modal(
base,
t!("Select Color"),
-1
View File
@@ -380,7 +380,6 @@ impl OpenCADStudio {
&self.model_bg_input,
&self.paper_bg_input,
&self.desk_bg_input,
self.bg_picker,
dirty,
close_confirm,
flow,