daily-color
v2.3.13
Published
Provides a unique hex code each day
Maintainers
Readme
daily-color
Provides a unique hex code each day
Install
Install from npmjs.com/package/daily-color:
npm install daily-colorUse
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.druewilding.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:
dailycolorJust want to see today's color?
There is a demo on www.druewilding.com/daily-color
Want to see a particular date? No problem, just add a date parameter, for example www.druewilding.com/daily-color/?date=2025-01-29
And if you want to see the coming colors for the next month you can see them on www.druewilding.com/daily-color/month
Development
Install dependencies:
npm installRun tests:
npm run testCompile the dist code, for projects without NPM:
npm run webpackThe project uses ESLint and Prettier to ensure consistent coding standards.
npm run lint
npm run format
npm run package:lintlintwill check for errors and fix formatting in.tsand.jsfiles.formatwill apply format rules to all possible files.package:lintwill warn of any inconsistencies in thepackage.jsonfile.
