Interface ContextUtils

Utility methods for various operations in Penpot.

interface ContextUtils {
    geometry: ContextGeometryUtils;
    types: ContextTypesUtils;
}

Properties

Properties

Geometry utility methods for Penpot. Provides methods for geometric calculations, such as finding the center of a group of shapes.

const centerPoint = penpot.utils.geometry.center(shapes);
console.log(centerPoint);

Type utility methods for Penpot. Provides methods for determining the types of various shapes in Penpot.

const isBoard = utils.types.isBoard(shape);
console.log(isBoard);