Developer Builds Vanilla JS Colour Palette Generator as Part of Weekly Project Challenge
A developer learning software engineering built a colour palette generator using only HTML, CSS, and JavaScript as part of a self-imposed challenge to ship one project per week before adopting frameworks. The tool generates a random five-colour palette on load or button click, allowing users to copy any hex code to their clipboard by clicking a colour swatch or its icon. Key techniques used include DOM manipulation, event delegation on a parent container for better performance, and the browser's Promise-based navigator.clipboard API for handling copy actions. A visual confirmation feature briefly swaps the copy icon to a checkmark for 1.5 seconds to provide clear user feedback. The developer plans future improvements such as locking individual colours, saving palettes via localStorage, keyboard shortcuts, and CSS variable exports.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in