For initialization the constructor needs a mix of config and draw-settings.

interface PBParams {
    autoAdjustOffset: boolean;
    autoDetectRetina: boolean;
    backgroundColor: string;
    blur?: number;
    brightness?: number;
    canvas: string | HTMLCanvasElement | SVGElement;
    canvasHeightFactor: number;
    canvasWidthFactor: number;
    contrast?: number;
    cssScaleX: number;
    cssScaleY: number;
    cssUniformScale: boolean;
    defaultCanvasHeight: number;
    defaultCanvasWidth: number;
    drawOrigin: boolean;
    drawRaster: boolean;
    dropShadow?: number;
    dropShadowColor?: string;
    effectFilterColor?: string;
    enableGL?: boolean;
    enableKeys: boolean;
    enableMouse: boolean;
    enableMouseWheel: boolean;
    enablePan: boolean;
    enableSVGExport: boolean;
    enableTouch: boolean;
    enableZoom: boolean;
    fitToParent: boolean;
    fullSize: boolean;
    grayscale?: number;
    hueRotate?: number;
    invert?: number;
    isBackdropFiltersEnabled?: boolean;
    isBlurEnabled?: boolean;
    isBrightnessEnabled?: boolean;
    isContrastEnabled?: boolean;
    isDropShadowEnabled?: boolean;
    isEffectsColorEnabled?: boolean;
    isGrayscaleEnabled?: boolean;
    isHueRotateEnabled?: boolean;
    isInvertEnabled?: boolean;
    isOpacityEnabled?: boolean;
    isSaturateEnabled?: boolean;
    isSepiaEnabled?: boolean;
    offsetAdjustXPercent: number;
    offsetAdjustYPercent: number;
    offsetX: number;
    offsetY: number;
    opacity?: number;
    postDraw?: ((draw, fill) => void);
    preClear?: (() => void);
    preDraw?: ((draw, fill) => void);
    rasterAdjustFactor: number;
    rasterGrid: boolean;
    rasterScaleX: number;
    rasterScaleY: number;
    redrawOnResize: boolean;
    saturate?: number;
    saveFile?: (() => void);
    scaleX: number;
    scaleY: number;
    sepia?: number;
    setToRetina?: (() => void);
    title?: string;
}

Hierarchy (view full)

Properties

autoAdjustOffset: boolean
autoDetectRetina: boolean
backgroundColor: string
blur?: number
brightness?: number
canvas: string | HTMLCanvasElement | SVGElement
canvasHeightFactor: number
canvasWidthFactor: number
contrast?: number
cssScaleX: number
cssScaleY: number
cssUniformScale: boolean
defaultCanvasHeight: number
defaultCanvasWidth: number
drawOrigin: boolean
drawRaster: boolean
dropShadow?: number
dropShadowColor?: string
effectFilterColor?: string
enableGL?: boolean
enableKeys: boolean
enableMouse: boolean
enableMouseWheel: boolean
enablePan: boolean
enableSVGExport: boolean
enableTouch: boolean
enableZoom: boolean
fitToParent: boolean
fullSize: boolean
grayscale?: number
hueRotate?: number
invert?: number
isBackdropFiltersEnabled?: boolean
isBlurEnabled?: boolean
isBrightnessEnabled?: boolean
isContrastEnabled?: boolean
isDropShadowEnabled?: boolean
isEffectsColorEnabled?: boolean
isGrayscaleEnabled?: boolean
isHueRotateEnabled?: boolean
isInvertEnabled?: boolean
isOpacityEnabled?: boolean
isSaturateEnabled?: boolean
isSepiaEnabled?: boolean
offsetAdjustXPercent: number
offsetAdjustYPercent: number
offsetX: number
offsetY: number
opacity?: number
postDraw?: ((draw, fill) => void)

Type declaration

    • (draw, fill): void
    • Parameters

      Returns void

preClear?: (() => void)

Type declaration

    • (): void
    • Returns void

preDraw?: ((draw, fill) => void)

Type declaration

    • (draw, fill): void
    • Parameters

      Returns void

rasterAdjustFactor: number
rasterGrid: boolean
rasterScaleX: number
rasterScaleY: number
redrawOnResize: boolean
saturate?: number
saveFile?: (() => void)

Type declaration

    • (): void
    • Returns void

scaleX: number
scaleY: number
sepia?: number
setToRetina?: (() => void)

Type declaration

    • (): void
    • Returns void

title?: string