Tego Bot API Documentation v0.1.1
Tego Bot API Documentation / getPixelColor
Function: getPixelColor()
getPixelColor(
x,y):Promise<string>
Defined in: index.ts:485
Get the color of a pixel at specific screen coordinates
Parameters
x
number
X coordinate on screen
y
number
Y coordinate on screen
Returns
Promise<string>
Promise resolving to hex color string (e.g., "#FF0000")
Example
typescript
import { getPixelColor } from "@tego/botjs";
const color = await getPixelColor(100, 200);
console.log(`Pixel color: ${color}`);
if (color === "#FF0000") {
console.log("Pixel is red!");
}