mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 10:17:02 -06:00
The Color Picker gets an eyedropper button beside the New and Original
chips, and `ui.sampleScreenColor {stroke?, picker?}` shows the system's
color sampler. The command answers at once. When the person clicks a
color anywhere on the screen, the color becomes the fill or the stroke
through paint.setFill / paint.setStroke as one undo step, or with
`picker` it becomes the open Color Picker's color, which previews on the
selection as any pick does. Escape cancels the sampler. The sampled sRGB
color goes through Cms::srgb_to_rgb, so in a Display P3 working space a
color inside sRGB shows as it did on the screen. `ui.inspect` reports
`screenSampler` while the sampler is open.
- macOS uses NSColorSampler (apps/vectorcraft/src/mac_screen_color.rs).
- The web app uses the browser's EyeDropper API where the browser has
one.
- Without a sampler (Windows, Linux, other browsers) the button is gray
and the command returns an error. Keyboard Shortcuts lists the
command, so it can be given a key.
Docs: docs/control-protocol.md, docs/target-app-parity.md.
87 lines
4.4 KiB
TOML
87 lines
4.4 KiB
TOML
[package]
|
|
name = "vectorcraft"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
publish = false
|
|
default-run = "vectorcraft"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = ["wgpu", "accessibility"]
|
|
wgpu = ["eframe/wgpu", "dep:winsafe"]
|
|
accessibility = ["eframe/accesskit"]
|
|
# Build with --no-default-features --features windows7 and the win7 Rust target.
|
|
windows7 = ["eframe/glow"]
|
|
|
|
[dependencies]
|
|
vectorcraft-engine = { workspace = true }
|
|
vectorcraft-ui-egui = { workspace = true }
|
|
vectorcraft-text = { workspace = true }
|
|
eframe = { workspace = true, features = ["default_fonts", "wayland", "x11"] }
|
|
egui = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
log = { workspace = true }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
rfd = { workspace = true }
|
|
# wayland-data-control: native Wayland clipboard (Linux; X11 through XWayland only sees what X11 apps copied).
|
|
arboard = { workspace = true, features = ["image-data", "wayland-data-control"] }
|
|
image = { workspace = true }
|
|
webbrowser = { workspace = true }
|
|
# The window's monitors, size and position (the same winit eframe runs on).
|
|
winit = { version = "0.30", default-features = false }
|
|
|
|
# The win7 target retains the viewer fallback; craft-print's WinRT PDF renderer needs newer Windows.
|
|
[target.'cfg(all(not(target_arch = "wasm32"), not(target_vendor = "win7")))'.dependencies]
|
|
craft-print = { workspace = true }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
clipboard-win = { workspace = true }
|
|
# Which GPU drives which display (EnumDisplayDevices, src/gpu.rs), so the window is drawn on the
|
|
# GPU that shows it: drawing on a GPU without a monitor reset the display driver. Safe wrappers over
|
|
# Win32 (MIT); the `user` feature is User32.dll only. Only the wgpu renderer chooses an adapter.
|
|
winsafe = { version = "0.0.29", default-features = false, features = ["user"], optional = true }
|
|
|
|
# DirectWrite's system font collection (src/system_fonts.rs): fonts that font services such as
|
|
# Adobe Fonts load in place (#579). MIT OR Apache-2.0, already in the build through accesskit.
|
|
[target.'cfg(all(windows, not(target_vendor = "win7")))'.dependencies]
|
|
windows = { version = "0.62", features = ["Win32_Graphics_DirectWrite"] }
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
# The macOS menu bar (src/mac_menu.rs): Tauri's menu crate, AppKit menus behind a safe API (no GTK
|
|
# with default features off). Pinned exactly: review the diff before bumping.
|
|
muda = { version = "=0.21.1", default-features = false }
|
|
objc2 = "0.6"
|
|
objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "block2", "objc2-core-foundation", "NSApplication", "NSButton", "NSColor", "NSColorSampler", "NSColorSpace", "NSControl", "NSMenu", "NSEvent", "NSPasteboard", "NSPopUpButton", "NSResponder", "NSSavePanel", "NSTextField", "NSTextInputContext", "NSView", "NSWindow"] }
|
|
# Files opened from Finder and the Dock (src/open_documents.rs) and pasted bitmaps (src/clipboard.rs); both already come with winit, muda and rfd.
|
|
objc2-foundation = { version = "0.3", default-features = false, features = ["std", "block2", "NSArray", "NSData", "NSGeometry", "NSNotification", "NSOperation", "NSString", "NSURL"] }
|
|
block2 = "0.6"
|
|
# The window's AppKit view, to centre its buttons on the app bar (src/mac_window.rs). MIT OR
|
|
# Apache-2.0 OR Zlib, already in the build through eframe and winit.
|
|
raw-window-handle = "0.6"
|
|
# CoreText's font manager (src/mac_fonts.rs): fonts that apps and font managers register from their
|
|
# own folders (#579). Zlib OR Apache-2.0 OR MIT; objc2-core-foundation already comes with
|
|
# objc2-foundation.
|
|
objc2-core-foundation = { version = "0.3", default-features = false, features = ["std", "CFArray", "CFString", "CFURL"] }
|
|
objc2-core-text = { version = "0.3", default-features = false, features = ["std", "CTFontManager"] }
|
|
# Waits for the answer of a file dialog shown as a sheet (src/main.rs, #867). MIT OR Apache-2.0,
|
|
# already in the build through eframe.
|
|
pollster = "1"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
# Asks the Wayland compositor which GPU it draws with (linux-dmabuf feedback, src/compositor_gpu.rs),
|
|
# so Automatic draws on that one. Both are already in the build through winit.
|
|
wayland-client = "0.31"
|
|
wayland-protocols = { version = "0.32", features = ["client"] }
|
|
|
|
[build-dependencies]
|
|
# Icon + VERSIONINFO for vectorcraft.exe; build.rs only uses it when targeting Windows.
|
|
winresource = "0.1"
|
|
|
|
[dev-dependencies]
|
|
# Bound socket buffers in real loopback transport deadline regressions.
|
|
socket2 = { workspace = true }
|