Brand palette generator
A hexadecimal colour field that computes a palette live (primary, hover, background, text), shows the WCAG contrast ratios and gives the CSS variables to copy.
- Tailwind
- React
- CSS
- WordPress
Description
For a brand guidelines page, a free tool on an agency or designer website, or the onboarding of a service that customises its clients’ colours. Type a hexadecimal colour (#1d5fa8 or the short form #e52, with or without the hash), pick it from the browser’s colour picker or start from one of the five sample colours. Everything follows on each keystroke: the hover colour, a very light background and a very dark text of the same hue, and the button text colour, white or dark depending on which contrasts better. The hover shade always moves away from that text, so hovering a button never lowers its contrast. Four contrast ratios are computed with the WCAG 2.2 formula (text on background, button text, hovered button, link on background), truncated to two decimals so that 4.497 never passes for compliant, with a level written out in words (AAA, AA, large text only, insufficient) rather than shown by colour alone. When a colour is too light for links, a tip explains what to do. A preview shows the palette applied to text, a link and two buttons. The CSS variables (--marque-primaire, --marque-survol, --marque-fond, --marque-texte, --marque-sur-primaire) are copied in one click; if the browser denies clipboard access, the code is selected for Ctrl+C. An invalid entry is flagged when leaving the field, without erasing the last valid palette. Changes are announced to screen readers through an aria-live region, after a pause in typing rather than on every key. Without JavaScript, the default palette and its variables remain readable. With prefers-reduced-motion, colours change without fading. No dependencies, AA contrast in light and dark mode, 44 px targets, no horizontal scrolling from 360 px.
Code
Loading the code…
The code of this component in
Archive contents
formulaire-generateur-palette-marque-html-tailwind.zip3 files · 10 Ko
- index.html25 Ko
- README.md5 Ko
- LICENSE.md1 Ko
Tags
Updated on December 3, 2026.
Reviews
No reviews yet.
In the same spirit

A recruitment form for small businesses: target position, introduction, CV checked in the browser and GDPR consent, with inline errors.
- Tailwind
- React
- CSS
- WordPress

A quote request form for tradespeople: the customer describes the work, picks a start date range and attaches up to six site photos, each with a preview, its size and a button to remove it.
- Tailwind
- React
- CSS
- WordPress

A quote request form whose labels, hints and error messages are full French sentences, still readable at 320 px: nothing overflows, nothing is cut off, and each error is tied to its field.
- Tailwind
- React
- CSS
- WordPress

Visitors pick a package and tick options: the pre-tax total, VAT and total including tax update live, and the summary is sent with the contact form.
- Tailwind
- React
- CSS
- WordPress