Comparing version 3.4.1 to 3.4.2
@@ -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 @@ /** |
{ | ||
"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 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1020355