Was a little inspired by that color app that was posted earlier today and I got to thinking that I maybe want to build a color picker app. Does compose desktop allow you to hook into accessibility on mac in order to grab colors from other apps? Or would I have to build a native mac app to access those apis?
j
jim
02/11/2021, 2:29 AM
That isn't a compose-specific question, as you would use the same APIs that you would use for any desktop Java application. I don't think there are any pure Java APIs to do that, but you could certainly achieve it using a bit of JNI.
c
Colton Idle
02/11/2021, 2:35 AM
Sorry. As an Android dev all of this is still very new to me. I guess what you said makes sense though that anything that you can typically do in desktop java, you can do with compose. Thanks
r
romainguy
02/11/2021, 2:43 AM
java.awt.Robot might do what you want
👍 1
k
Kirill Grouchnikov
02/11/2021, 4:40 AM
On Big Sur, using those Robot APIs will pop up a security warning and the user will need to grant Java runtime the relevant permissions
r
romainguy
02/11/2021, 4:27 PM
FTW it’s true of native apps that want to read the screen to pick colors as well