Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

daily-color

aimeerivers89ISC2.3.10TypeScript support: included

Provides a unique hex code each day

color, daily, date, hash, hex color

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

Want to see a particular date? No problem, just add a date parameter, for example www.aimeerivers.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.aimeerivers.com/daily-color/month

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 the package.json file.

changelog

Changelog

2.3.10 (2025-09-21)

Chores

  • Update eslint-config-plus-prettier to 4.2.2 (#59) (06a05c9)

2.3.9 (2025-09-18)

Continuous Integration

2.3.8 (2025-08-25)

Chores

2.3.7 (2025-07-20)

Chores

2.3.6 (2025-06-20)

Chores

  • Update eslint-config-plus-prettier to 4.1.13 (#51) (1936e74)

2.3.5 (2025-06-07)

Chores

2.3.4 (2025-05-12)

Dependencies

2.3.3 (2025-04-13)

Dependencies

2.3.2 (2025-03-14)

Dependencies

2.3.1 (2025-02-12)

Dependencies

2.3.0 (2025-01-30)

Features

  • Enable seeing a different date in the demo site (#38) (a1a0744)

2.2.1 (2025-01-14)

Dependencies

2.2.0 (2024-12-25)

Features

2.1.5 (2024-12-12)

Dependencies

2.1.4 (2024-11-30)

Dependencies

2.1.3 (2024-11-29)

Dependencies

  • Update eslint-config-plus-prettier (#28) (aa3fec5)

2.1.2 (2024-11-10)

Dependencies

  • Update to eslint-config-plus-prettier v4 (#26) (d617d48)

2.1.1 (2024-11-10)

Dependencies

  • Update eslint-config-plus-prettier (#24) (c8f1b93)

2.1.0 (2024-11-09)

Features

  • Enable getting color for a specific date (#20) (3cbac73)
  • Make the color vary more from day to day (#22) (beeda51)

2.0.1 (2024-11-09)

Bug Fixes

  • Add TypeScript declaration to make the module compatible with TyepScript (#17) (7df4681)

2.0.0 (2024-11-09)

⚠ BREAKING CHANGES

  • Importing with require will no longer work. Instead use import { getDailyColor } from "daily-color";

Features

1.3.1 (2024-11-09)

Bug Fixes

  • Make the text stand out slightly better on the demo page (#13) (f1a61bc)

1.3.0 (2024-11-09)

Features

1.2.0 (2024-11-09)

Features

  • Add an HTML page to show the current color of the day (#8) (e702363)

1.1.0 (2024-11-09)

Features

  • Provide a webpack bundle, for projects that don't use NPM (#6) (6d53597)

1.0.1 (2024-11-09)

Dependencies

1.0.0 (2024-11-09)

Features

Dependencies

  • Fix version (0a1af33)
  • Install eslint-config-plus-prettier (36e2f49)
  • Install npm-package-json-lint (6281541)
  • Uninstall npm-package-json-lint (9a330b1)
  • Update eslint-config-plus-prettier (e08d8d4)
  • Update eslint-config-plus-prettier to v1.6.0 which limits the eslint version (fd17ce9)