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

@jimp/plugin-color

Package Overview
Dependencies
Maintainers
2
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jimp/plugin-color - npm Package Compare versions

Comparing version 0.5.5 to 0.6.0

25

dist/index.js

@@ -219,24 +219,7 @@ "use strict";

var factor = (val + 1) / (1 - val);
function adjust(value) {
var x;
if (val < 0) {
x = value > 127 ? 1 - value / 255 : value / 255;
if (x < 0) {
x = 0;
}
x = 0.5 * Math.pow(x * 2, 1 + val);
return value > 127 ? (1.0 - x) * 255 : x * 255;
}
x = value > 127 ? 1 - value / 255 : value / 255;
if (x < 0) {
x = 0;
}
x = 0.5 * Math.pow(2 * x, val === 1 ? 127 : 1 / (1 - val));
return value > 127 ? (1 - x) * 255 : x * 255;
value = Math.floor(factor * (value - 127) + 127);
return value < 0 ? 0 : value > 255 ? 255 : value;
}

@@ -243,0 +226,0 @@

@@ -187,24 +187,7 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }

var factor = (val + 1) / (1 - val);
function adjust(value) {
var x;
if (val < 0) {
x = value > 127 ? 1 - value / 255 : value / 255;
if (x < 0) {
x = 0;
}
x = 0.5 * Math.pow(x * 2, 1 + val);
return value > 127 ? (1.0 - x) * 255 : x * 255;
}
x = value > 127 ? 1 - value / 255 : value / 255;
if (x < 0) {
x = 0;
}
x = 0.5 * Math.pow(2 * x, val === 1 ? 127 : 1 / (1 - val));
return value > 127 ? (1 - x) * 255 : x * 255;
value = Math.floor(factor * (value - 127) + 127);
return value < 0 ? 0 : value > 255 ? 255 : value;
}

@@ -211,0 +194,0 @@

12

package.json
{
"name": "@jimp/plugin-color",
"version": "0.5.5",
"version": "0.6.0",
"description": "Bitmap manipulation to adjust the color in an image.",

@@ -22,3 +22,3 @@ "main": "dist/index.js",

"dependencies": {
"@jimp/utils": "^0.5.0",
"@jimp/utils": "^0.6.0",
"core-js": "^2.5.7",

@@ -28,5 +28,5 @@ "tinycolor2": "^1.4.1"

"devDependencies": {
"@jimp/custom": "^0.5.4",
"@jimp/test-utils": "^0.5.4",
"@jimp/types": "^0.5.4"
"@jimp/custom": "^0.6.0",
"@jimp/test-utils": "^0.6.0",
"@jimp/types": "^0.6.0"
},

@@ -39,3 +39,3 @@ "peerDependencies": {

},
"gitHead": "72634d1c6c614a925bf1bc5e861e3640f5c0bf98"
"gitHead": "ff78c045c32a9fff55f7fd92f72fa57409126485"
}

@@ -193,26 +193,8 @@ import tinyColor from 'tinycolor2';

const factor = (val + 1) / (1 - val);
function adjust(value) {
let x;
value = Math.floor(factor * (value - 127) + 127);
if (val < 0) {
x = value > 127 ? 1 - value / 255 : value / 255;
if (x < 0) {
x = 0;
}
x = 0.5 * Math.pow(x * 2, 1 + val);
return value > 127 ? (1.0 - x) * 255 : x * 255;
}
x = value > 127 ? 1 - value / 255 : value / 255;
if (x < 0) {
x = 0;
}
x = 0.5 * Math.pow(2 * x, val === 1 ? 127 : 1 / (1 - val));
return value > 127 ? (1 - x) * 255 : x * 255;
return value < 0 ? 0 : value > 255 ? 255 : value;
}

@@ -219,0 +201,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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