Skip to content

Instantly share code, notes, and snippets.

@kentkrantz
Created May 6, 2020 09:11
Show Gist options
  • Select an option

  • Save kentkrantz/23ff823e526b98e8b98114b2b3223f98 to your computer and use it in GitHub Desktop.

Select an option

Save kentkrantz/23ff823e526b98e8b98114b2b3223f98 to your computer and use it in GitHub Desktop.
// 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