Utilities

This example will showcase the different utility functions available.

const { Utils } = require("pixelplacejs");
const fs = require("fs");


const CANVAS_ID = 7;
let canvasBuffer = Utils.getLatestCanvasPNG(CANVAS_ID);
let pixelplaceColor = Utils.getColorFromRGB(255, 255, 255);
let palive = Utils.generatePingAlive();

fs.writeFileSync(canvasBuffer, "map.png");

console.log(`White's PixelPlace color ID is: ${pixelplaceColor}`);
console.log(`Valid palive at the current second is ${palive}`);

Last updated

Was this helpful?