daily-color
v2.1.2
Published
Provides a unique hex code each day
Downloads
788
Maintainers
Readme
daily-color
Provides a unique hex code each day
Install
Install from npmjs.com/package/daily-color:
npm install daily-color
Use
In a JavaScript/TypeScript project, using NPM:
import { getDailyColor } from "daily-color";
console.log("Today's color is:", getDailyColor());
console.log("Another day's color is:", getDailyColor(new Date("2024-11-09")));
Directly loading the bundled JavaScript, for static projects not using NPM:
<script type="module">
import { getDailyColor } from "https://www.aimeerivers.com/daily-color/dist/daily-color.js";
console.log("Today's color is:", getDailyColor());
console.log("Another day's color is:", getDailyColor(new Date("2024-11-09")));
</script>
Using the CLI:
dailycolor
Just want to see today's color?
There is a demo on www.aimeerivers.com/daily-color
Development
Install dependencies:
npm install
Run tests:
npm run test
Compile the dist code, for projects without NPM:
npm run webpack
The project uses ESLint and Prettier to ensure consistent coding standards.
npm run lint
npm run format
npm run package:lint
lint
will check for errors and fix formatting in.ts
and.js
files.format
will apply format rules to all possible files.package:lint
will warn of any inconsistencies in thepackage.json
file.