culurs
v0.1.1
Published
Get random contrasting colors
Downloads
15
Readme
Culurs
Installation
npm install --save-dev culurs
import culurs from 'culurs';
Styling with CSS variables
body {
background-color: var(--primary);
color: var(--secondary);
}
const paint = culurs(0.5, 0.7, 'primary', 'secondary');
setInterval(paint, 1000);
Styling in JavaScript
const colors = culurs(0.5, 0.3);
function paint() {
const [primary, secondary] = colors();
document.body.style.backgroundColor = primary;
document.body.style.color = secondary;
}
setInterval(paint, 1000);