Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-color

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-color - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

2

package.json
{
"name": "canvas-color",
"version": "2.0.4",
"version": "2.0.5",
"description": "color",

@@ -5,0 +5,0 @@ "keywords": [

@@ -29,2 +29,11 @@ ;(function(root, factory) {

function getBase64(img) {
var canvas = document.createElement('canvas');
canvas.height = img.height;
canvas.width = img.width;
var ctx=canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
return canvas.toDataURL();
}
CanvasColor.prototype.init = function() {

@@ -36,3 +45,2 @@ var that = this;

canvas.height = this.size;
document.body.appendChild(canvas);
var context = canvas.getContext('2d');

@@ -46,5 +54,4 @@ var img = new Image();

var res = that.getRGB(data, that.size, that.size);
res.imgData = img.src;
res.imgData = getBase64(img);
that.onSuccess(res);
canvas.parentNode.removeChild(canvas);
};

@@ -51,0 +58,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc