开发者

Raphaeljs: specify the spectrum of getColor()

开发者 https://www.devze.com 2023-02-10 04:33 出处:网络
I am using the raphaeljs library and I would like to specify the colors given by the getColor fu开发者_StackOverflow社区nction.

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

精彩评论

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

关注公众号