Skip to content

Tego Bot API Documentation v0.2.0


Tego Bot API Documentation / bitmapColorAt

Function: bitmapColorAt() ​

bitmapColorAt(bitmap, x, y): string

Defined in: botjs/src/index.ts:389

Get the color at specific coordinates in a bitmap

Parameters ​

bitmap ​

Bitmap

Bitmap object from screen capture

x ​

number

X coordinate in the bitmap

y ​

number

Y coordinate in the bitmap

Returns ​

string

Hex color string (e.g., "#FF0000" for red)

Example ​

typescript
import { captureScreen, bitmapColorAt } from "@tego/botjs";

const screenshot = await captureScreen();
const color = bitmapColorAt(screenshot, 100, 200);
console.log(`Color at (100, 200): ${color}`);

Released under the MIT License.