/** * This class represents a pencil line on the canvas * @author Eirik Måseidvåg */ import { CanvasElementName } from '..'; import { PencilOptions, PencilStrokeStyle } from './types'; import CanvasElement from '../abstract/CanvasElement'; export default class Pencil extends CanvasElement { /** * The color of the stroke. Represented as a hexadecimal number * E.g. 0xffffff (white) * @public */ color: number; /** * The width of the stroke * @public */ strokeWidth: number; /** * The style of the pencils border * @public */ strokeStyle: PencilStrokeStyle; /** * The opacity of the pencils body. Represented by a float between 0 and 1 * @public */ opacity: number; /** * The points to draw the lines in order * @public */ points: Array<{ x: number; y: number; }>; /** * Returns the type of this canvas element * @returns CanvasElementName.PENCIL */ name: CanvasElementName; /** * Construct the object * @param options: PencilOptions */ constructor(options: PencilOptions); }