Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add macOS built-in color picker capability
`osascript` is the built-in automation program in macOS. The method of triggering the macOS color picker from `osascript` is documented here: https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/PromptforaColor.html#//apple_ref/doc/uid/TP40016239-CH86-SW1 There is a weirdness of `osascript` in that `console.log` only writes to `stderr` regardless of the documented "write to stdout" flag. A workaround was found here and linked in the relevant comment: https://apple.stackexchange.com/a/278395 The picker is only attempted when `#[cfg(target_os = "macos")]`. However it's still listed in the "Supported tools" help text because `clap` make it somewhat hard to customize that help text (e.g. generating from the list of tools) because it does not take ownership of strings. Related: clap-rs/clap#1041
- Loading branch information