Overview of the Program available at colorgen.richardsblogs.com
The program Random Color Generator is a lightweight, responsive web application that lets you generate fully random colors in three formats:
- Hex (with alpha support):
#RRGGBB(preview uses RGBA alpha) - RGBA:
rgba(r, g, b, a) - HSLA:
hsla(h, s%, l%, a)Click Generate Random Color to update the color codes and see a live preview. Text contrast adjusts automatically for readability in both light and dark modes.
- Clone this repository:
git clone https://github.com/richie-rich90454/random_color_gen.git cd random_color_gen - Install dependencies:
npm install
- Run the Fastify server:
node server.js
- View the app at
http://localhost:6007in your browser.
- Generate random Hex colors (e.g.,
#A1B2C3). - Generate random RGBA colors (e.g.,
rgba(123, 45, 67, 0.82)). - Generate random HSLA colors (e.g.,
hsla(240, 100%, 50%, 0.75)). - Real-time preview with smooth fade animations.
- Automatic text-contrast adjustment for accessibility.
- Light & dark theme support (system preference).
random_color_gen/
├── index.html # Main HTML
├── script.js # Color generation and preview logic
├── script.min.js # Minified JS (using Terser)
├── EBGaramond-VariableFont_wght.ttf # EB Garamond font (OFL-EB_Garamond)
├── NotoSans-VariableFont_wdth,wght.ttf# Noto Sans font (OFL-Noto_Sans)
├── server.js # Fastify server to serve static files
├── package.json # Project metadata & dependencies
└── README.md # This documentation file
- Clone the repo:
git clone https://github.com/richie-rich90454/random_color_gen.git cd random_color_gen - Install dependencies:
npm install
- Start the server:
node server.js
- Open in your browser at
http://localhost:6007.
- Click Generate Random Color.
- Watch the Hex, RGBA, and HSLA previews update with smooth animations.
- Preference switch between light/dark follows your OS setting.
- HTML5, CSS3 (with CSS Custom Properties & media queries)
- JavaScript (ES6+)
- Terser for minification
- Fastify (Node.js web framework)
- Client code: Apache 2.0 (LICENSE)
- Fonts: SIL Open Font License 1.1
- EB Garamond: © 2017 The EB Garamond Project Authors
- Noto Sans: © 2022 The Noto Project Authors
(Full font license texts in
font_licenses/)