Skip to content

Tego Bot API Documentation v0.1.1


Tego Bot API Documentation / bitmapColorAt

Function: bitmapColorAt()

bitmapColorAt(bitmap, x, y): string

Defined in: index.ts:411

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.