开发者

Raphaeljs: specify the spectrum of getColor()

I am using the raphaeljs library and I would like to specify the colors given by the getColor fu开发者_StackOverflow社区nction. If this is possible, how to do? Thanks


It's not possible. The only argument the function takes is the brightness. Here's the 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;
    };
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜