MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / lift

Function lift

libs/echarts/echarts-en.simple.js:4003–4022  ·  view source on GitHub ↗

* @param {string} color * @param {number} level * @return {string} * @memberOf module:zrender/util/color

(color, level)

Source from the content-addressed store, hash-verified

4001 * @memberOf module:zrender/util/color
4002 */
4003function lift(color, level) {
4004 var colorArr = parse(color);
4005 if (colorArr) {
4006 for (var i = 0; i < 3; i++) {
4007 if (level < 0) {
4008 colorArr[i] = colorArr[i] * (1 - level) | 0;
4009 }
4010 else {
4011 colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;
4012 }
4013 if (colorArr[i] > 255) {
4014 colorArr[i] = 255;
4015 }
4016 else if (color[i] < 0) {
4017 colorArr[i] = 0;
4018 }
4019 }
4020 return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');
4021 }
4022}
4023
4024/**
4025 * @param {string} color

Callers 1

liftColorFunction · 0.70

Calls 2

parseFunction · 0.70
stringifyFunction · 0.70

Tested by

no test coverage detected