0.0.0 • Published 1 month ago

paint-bucket-fill v0.0.0

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

paint-bucket-fill

Quick Start

  1. Installation dependencies

    npm i paint-bucket-fill
    # yarn add paint-bucket-fill
    # pnpm i paint-bucket-fill
  2. Import and use in code

    import PaintBucketFill from 'paint-bucket-fill'
    
    const canvasEl = document.querySelector('#canvas')
    
    const paintBucketFill = new PaintBucketFill({ canvasEl })
    paintBucketFill.setFillColor('#000000')
    
    const fileInput = document.querySelector('#fileInput')
    fileInput.addEventListener('change', e => {
      const file = e.target.files[0]
      paintBucketFill.setImage({ imageFile: file })
    })