Created
May 6, 2020 09:11
-
-
Save kentkrantz/23ff823e526b98e8b98114b2b3223f98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // import functions from the main module of AutoTouch | |
| const { getColors, getColor } = at | |
| // getColor(x, y) | |
| const [result, error] = getColor(100, 200) | |
| if (error) { | |
| alert('Failed to get color, error: %s', error) | |
| } else { | |
| alert('Got result by getColor', result); | |
| } | |
| // getColors([{x: x1, y: y1}, {x: x2, y: y2}, ...]) | |
| const [result1, error1] = getColors([ | |
| {x: 100, y: 100}, | |
| {x: 200, y: 200}, | |
| {x: 300, y: 300}, | |
| {x: 400, y: 400}, | |
| ]) | |
| if (error1) { | |
| alert('Failed to get colors, error: %s', error) | |
| } else { | |
| console.log(result1) | |
| alert('getColors result1:', result1) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment