(o)
| 3428 | BC_DA = B$1 * C - D$1 * A; |
| 3429 | |
| 3430 | function cubehelixConvert(o) { |
| 3431 | if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); |
| 3432 | if (!(o instanceof Rgb)) o = rgbConvert(o); |
| 3433 | var r = o.r / 255, |
| 3434 | g = o.g / 255, |
| 3435 | b = o.b / 255, |
| 3436 | l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), |
| 3437 | bl = b - l, |
| 3438 | k = (E * (g - l) - C * bl) / D$1, |
| 3439 | s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 |
| 3440 | h = s ? Math.atan2(k, bl) * degrees$2 - 120 : NaN; |
| 3441 | return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); |
| 3442 | } |
| 3443 | |
| 3444 | function cubehelix$3(h, s, l, opacity) { |
| 3445 | return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); |
no test coverage detected