mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 04:48:11 +08:00
Revamp the ColorPicker popover and ColorInput widget (#830)
* Add cancel hint to Eyedropper tool * Improve eyedropper overlay CSS * Make CSS for transparent checkered background reusable * Add color choice preview to color picker * Draw text and markers as contrasting white or black * Add reactive color updating and new/initial swapping * Add Hex, RGB, HSV, and Opacity inputs * Add none color and preset buttons * Add eyedropper button and fix alignment (now visually done) * Wire up none colors through the backend and style the ColorInput widget * Add color info chip to ColorInput widget * Fix all UX bugs * Add more tooltips * Fix FloatingMenu recursive loop * Prevent mouse stray from closing color picker while dragging pickers Closes #703 * Fix deselect all layers shortcut * Add temporary eyedropper for Chromium browsers and a coming soon fallback
This commit is contained in:
@@ -353,6 +353,15 @@ impl JsEditorHandle {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Begin sampling a pixel color from the document by entering eyedropper sampling mode
|
||||
#[wasm_bindgen(js_name = eyedropperSampleForColorPicker)]
|
||||
pub fn eyedropper_sample_for_color_picker(&self) -> Result<(), JsValue> {
|
||||
let message = DialogMessage::RequestComingSoonDialog { issue: Some(832) };
|
||||
self.dispatch(message);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Update primary color with values on a scale from 0 to 1.
|
||||
#[wasm_bindgen(js_name = updatePrimaryColor)]
|
||||
pub fn update_primary_color(&self, red: f32, green: f32, blue: f32, alpha: f32) -> Result<(), JsValue> {
|
||||
|
||||
Reference in New Issue
Block a user