About
This page lists software / application and library around the manipulation and creation of color.
List
d3-color
How to work with color in d3: working with color
const color1 = d3.hsl("#075ebb") // hexadecimal RGB
console.log(`hue: ${color1.h} degree`);
console.log(`saturation: ${color1.s} `);
console.log(`lightness: ${color1.l} `);
ColorsJs
Qix
Example: color spaces / Color value conversion between with Qix
var color = Color('#7743CE').alpha(0.5).lighten(0.5);
console.log(color.hsl().string()); // 'hsla(262, 59%, 81%, 0.5)'
console.log(color.cmyk().round().array()); // [ 16, 25, 0, 8, 0.5 ]
console.log(color.ansi256().object()); // { ansi256: 183, alpha: 0.5 }
Random Color
'#' + Math.floor(Math.random()*16777215).toString(16);
- Attractive: https://github.com/davidmerfield/randomColor
randomColor({hue: 'pink', count: 18}).forEach(color => {
document.body.insertAdjacentHTML(
'afterend',
'<span class="circle" style="background: '+color+';">'+color+'</span>'
);
});