javascript - 拉斐尔 : specify the spectrum of getColor()

标签 javascript raphael

我正在使用 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/

相关文章:

javascript - 重用带参数的 Promise

javascript - CSS3 矩阵旋转

javascript - 为什么我的重复删除脚本没有捕获唯一值

javascript - Angularjs 对记录中某个字段的数据进行分组

svg - 干净地变形 SVG 路径

加载页面后聚焦于某个div的Javascript代码

javascript - Raphael JS 中的文本转换

javascript - 如何使数组对象随机移动?

javascript - 拉斐尔路径交叉点不起作用

javascript - 使用 Raphael 调用 requestAnimationFrame 是否会影响性能?