我正在使用 raphaeljs 库,我想指定 getColor
给出的颜色功能。
如果可以的话,该怎么办?
谢谢
最佳答案
这是不可能的。该函数采用的唯一参数是亮度。这是code taken from v1.5.2
R.getColor = function (value) {
var start = this.getColor.start = this.getColor.start || {h: 0, s: 1, b: value || .75},
rgb = this.hsb2rgb(start.h, start.s, start.b);
start.h += .075;
if (start.h > 1) {
start.h = 0;
start.s -= .2;
start.s <= 0 && (this.getColor.start = {h: 0, s: 1, b: start.b});
}
return rgb.hex;
};
关于javascript - 拉斐尔 : specify the spectrum of getColor(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4993293/