MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / alpha

Method alpha

src/common/overlay/levelRenderer/Color.js:829–840  ·  view source on GitHub ↗

* @function LevelRenderer.Tool.Color.prototype.alpha * @description 设置颜色透明度 * @param {string} color - 颜色。 * @param {number} a - 透明度,区间[0,1]。 * @returns {string} rgba颜色值

(color, a)

Source from the content-addressed store, hash-verified

827 * @returns {string} rgba颜色值
828 */
829 alpha(color, a) {
830 if (!this.isCalculableColor(color)) {
831 return color;
832 }
833 if (a === null) {
834 a = 1;
835 }
836 var data = this.getData(this.toRGBA(color));
837 data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
838
839 return this.toColor(data, 'rgba');
840 }
841
842 /**
843 * @function LevelRenderer.Tool.Color.prototype.map

Callers 2

ColorSpec.jsFile · 0.80
getColorWithOpacityMethod · 0.80

Calls 5

isCalculableColorMethod · 0.95
getDataMethod · 0.95
toRGBAMethod · 0.95
adjustMethod · 0.95
toColorMethod · 0.95

Tested by

no test coverage detected