Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 593 Bytes

README.md

File metadata and controls

40 lines (29 loc) · 593 Bytes

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);