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

zrender

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zrender - npm Package Compare versions

Comparing version 3.4.1 to 3.4.2

15

lib/tool/color.js

@@ -399,15 +399,17 @@ /**

/**
* Map value to color. Faster than mapToColor methods because color is represented by rgba array
* Map value to color. Faster than mapToColor methods because color is represented by rgba array.
* @param {number} normalizedValue A float between 0 and 1.
* @param {Array.<Array.<number>>} colors List of rgba color array
* @param {Array.<number>} [out] Mapped gba color array
* @return {Array.<number>}
* @return {Array.<number>} will be null/undefined if input illegal.
*/
function fastMapToColor(normalizedValue, colors, out) {
out = out || [0, 0, 0, 0];
if (!(colors && colors.length)
|| !(normalizedValue >= 0 && normalizedValue <= 1)
) {
return out;
return;
}
out = out || [];
var value = normalizedValue * (colors.length - 1);

@@ -423,2 +425,3 @@ var leftIndex = Math.floor(value);

out[3] = clampCssFloat(lerp(leftColor[3], rightColor[3], dv));
return out;

@@ -505,3 +508,3 @@ }

/**
* @param {Array.<string>} colors Color list.
* @param {Array.<number>} arrColor like [12,33,44,0.4]
* @param {string} type 'rgba', 'hsva', ...

@@ -511,3 +514,3 @@ * @return {string} Result color. (If input illegal, return undefined).

function stringify(arrColor, type) {
if (!arrColor) {
if (!arrColor || !arrColor.length) {
return;

@@ -514,0 +517,0 @@ }

2

lib/zrender.js

@@ -34,3 +34,3 @@ /*!

*/
zrender.version = '3.4.1';
zrender.version = '3.4.2';

@@ -37,0 +37,0 @@ /**

{
"name": "zrender",
"version": "3.4.1",
"version": "3.4.2",
"description": "A lightweight canvas library.",

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

@@ -399,15 +399,17 @@ /**

/**
* Map value to color. Faster than mapToColor methods because color is represented by rgba array
* Map value to color. Faster than mapToColor methods because color is represented by rgba array.
* @param {number} normalizedValue A float between 0 and 1.
* @param {Array.<Array.<number>>} colors List of rgba color array
* @param {Array.<number>} [out] Mapped gba color array
* @return {Array.<number>}
* @return {Array.<number>} will be null/undefined if input illegal.
*/
function fastMapToColor(normalizedValue, colors, out) {
out = out || [0, 0, 0, 0];
if (!(colors && colors.length)
|| !(normalizedValue >= 0 && normalizedValue <= 1)
) {
return out;
return;
}
out = out || [];
var value = normalizedValue * (colors.length - 1);

@@ -423,2 +425,3 @@ var leftIndex = Math.floor(value);

out[3] = clampCssFloat(lerp(leftColor[3], rightColor[3], dv));
return out;

@@ -505,3 +508,3 @@ }

/**
* @param {Array.<string>} colors Color list.
* @param {Array.<number>} arrColor like [12,33,44,0.4]
* @param {string} type 'rgba', 'hsva', ...

@@ -511,3 +514,3 @@ * @return {string} Result color. (If input illegal, return undefined).

function stringify(arrColor, type) {
if (!arrColor) {
if (!arrColor || !arrColor.length) {
return;

@@ -514,0 +517,0 @@ }

@@ -34,3 +34,3 @@ /*!

*/
zrender.version = '3.4.1';
zrender.version = '3.4.2';

@@ -37,0 +37,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