2.0.1 • Published 4 years ago
time-to-color-converter v2.0.1
Install
$ npm install time-to-color-converter
Usage
import convert from 'time-to-color-converter';
or
const convert = require('time-to-color-converter');
then
const { h, s, l } = convert(new Date(), false); // Set true to the second parameter if you use this for the southern hemisphere.
You can use these values like below.
document.getElementsByTagName('body')[0].style.backgroundColor = `hsl(${h}, ${s}%, ${l}%)`;