(clr, angle, d)
| 884 | } |
| 885 | |
| 886 | function analog(clr, angle, d) { |
| 887 | /* Returns a random adjacent color on the color wheel. |
| 888 | * Analogous color schemes can often be found in nature. |
| 889 | */ |
| 890 | if (angle === undefined) angle = 20; |
| 891 | if (d === undefined) d = 0.1; |
| 892 | var hsb = _rgb2hsb(clr.r, clr.g, clr.b); |
| 893 | var hsb = _rotateRYB(hsb[0], hsb[1], hsb[2], Math.random() * 2 * angle - angle); |
| 894 | hsb[1] *= 1 - Math.random()*2*d-d; |
| 895 | hsb[2] *= 1 - Math.random()*2*d-d; |
| 896 | return new Color(hsb[0], hsb[1], hsb[2], clr.a, {"colorspace":HSB}); |
| 897 | } |
| 898 | |
| 899 | /*--- COLOR MIXIN ----------------------------------------------------------------------------------*/ |
| 900 | // Drawing commands like rect() have optional parameters fill and stroke to set the color directly. |
nothing calls this directly
no test coverage detected
searching dependent graphs…