Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cHcl = cHcl.brighter(0.2);
cHcl = cHcl.darker();
cHcl = cHcl.darker(0.2);
cRGB = cHcl.rgb();
displayable = cHcl.displayable();
cString = cHcl.toString();
console.log('Channels = (h : %d, c: %d, l: %d)', cHcl.h, cHcl.c, cHcl.l);
console.log('Opacity = %d', cHcl.opacity);
// Signature tests for Cubehelix
let cCubehelix: d3Color.CubehelixColor;
cCubehelix = d3Color.cubehelix(20, 100, 200);
cCubehelix = d3Color.cubehelix(20, 100, 200, 0.5);
cCubehelix = d3Color.cubehelix('steelblue');
cCubehelix = d3Color.cubehelix('rgba(20, 100, 200, 0.5)');
cCubehelix = d3Color.cubehelix(c);
cCubehelix = cCubehelix.brighter();
cCubehelix = cCubehelix.brighter(0.2);
cCubehelix = cCubehelix.darker();
cCubehelix = cCubehelix.darker(0.2);
cRGB = cCubehelix.rgb();
displayable = cCubehelix.displayable();
cString = cCubehelix.toString();
console.log('Channels = (h : %d, s: %d, l: %d)', cCubehelix.h, cCubehelix.s, cCubehelix.l);
console.log('Opacity = %d', cCubehelix.opacity);
cHcl = cHcl.darker();
cHcl = cHcl.darker(0.2);
cRGB = cHcl.rgb();
displayable = cHcl.displayable();
cString = cHcl.toString();
console.log('Channels = (h : %d, c: %d, l: %d)', cHcl.h, cHcl.c, cHcl.l);
console.log('Opacity = %d', cHcl.opacity);
// Signature tests for Cubehelix
let cCubehelix: d3Color.CubehelixColor;
cCubehelix = d3Color.cubehelix(20, 100, 200);
cCubehelix = d3Color.cubehelix(20, 100, 200, 0.5);
cCubehelix = d3Color.cubehelix('steelblue');
cCubehelix = d3Color.cubehelix('rgba(20, 100, 200, 0.5)');
cCubehelix = d3Color.cubehelix(c);
cCubehelix = cCubehelix.brighter();
cCubehelix = cCubehelix.brighter(0.2);
cCubehelix = cCubehelix.darker();
cCubehelix = cCubehelix.darker(0.2);
cRGB = cCubehelix.rgb();
displayable = cCubehelix.displayable();
cString = cCubehelix.toString();
console.log('Channels = (h : %d, s: %d, l: %d)', cCubehelix.h, cCubehelix.s, cCubehelix.l);
console.log('Opacity = %d', cCubehelix.opacity);
import {cubehelix} from "d3-color";
import {interpolateCubehelixLong} from "d3-interpolate";
export var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
export var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
var c = cubehelix();
export default function(t) {
if (t < 0 || t > 1) t -= Math.floor(t);
var ts = Math.abs(t - 0.5);
c.h = 360 * t - 100;
c.s = 1.5 - 1.5 * ts;
c.l = 0.8 - 0.9 * ts;
return c + "";
}
function cubehelix(start, end) {
var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),
s = color(start.s, end.s),
l = color(start.l, end.l),
opacity = color(start.opacity, end.opacity);
return function(t) {
start.h = h(t);
start.s = s(t);
start.l = l(Math.pow(t, y));
start.opacity = opacity(t);
return start + "";
};
}
colors[key].forEach(function (c) {
c.pop();
var n = d3Color.rgb(c[0], c[1], c[2], 1);
var h = d3Color.cubehelix(n);
h.s = Math.max(h.s, 1);
h.l = Math.max(h.l, 0.8);
h.l = Math.min(h.l, 1.2);
c[0] = h.h;
c[1] = h.s;
c[2] = h.l;
});
import {cubehelix} from "d3-color";
import {interpolateCubehelixLong} from "d3-interpolate";
export var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
export var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
var rainbow = cubehelix();
export default function(t) {
if (t < 0 || t > 1) t -= Math.floor(t);
var ts = Math.abs(t - 0.5);
rainbow.h = 360 * t - 100;
rainbow.s = 1.5 - 1.5 * ts;
rainbow.l = 0.8 - 0.9 * ts;
return rainbow + "";
}
import {cubehelix} from "d3-color";
import {interpolateCubehelixLong} from "d3-interpolate";
export default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));
import {cubehelix} from "d3-color";
import {interpolateCubehelixLong} from "d3-interpolate";
export var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
export var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
var c = cubehelix();
export default function(t) {
if (t < 0 || t > 1) t -= Math.floor(t);
var ts = Math.abs(t - 0.5);
c.h = 360 * t - 100;
c.s = 1.5 - 1.5 * ts;
c.l = 0.8 - 0.9 * ts;
return c + "";
}
import {cubehelix} from "d3-color";
import {interpolateCubehelixLong} from "d3-interpolate";
export default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));
function cubehelix(a, b) {
a = color(a);
b = color(b);
var ah = a.h,
as = a.s,
al = a.l,
bh = b.h,
bs = b.s,
bl = b.l || 0;
if (isNaN(ah)) ah = bh;
if (isNaN(as)) as = bs;
if (isNaN(al)) al = bl;
bh = (bh - ah) || 0;
bs = (bs - as) || 0;
bl -= al;
return function(t) {
a.h = ah + bh * t;
a.s = as + bs * t;