Skip to content

braden337/culurs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Get random contrasting colors

Resources

Stars

Watchers

Forks