On this page

A useful alert palette begins with four jobs: showing success, warning someone, reporting an error, and sharing information. Start with a color that suits your site, explore possible companions with a palette generator, and assign a candidate to each job. Then check the actual text and background combinations you intend to use.
The goal is a set that feels coordinated while making each message easy to understand. A promising swatch is only a starting point: its usefulness also depends on the words, icons, and background beside it. The workflow below helps you move from a base color to a practical set you can review in every theme you use.
Start with the alerts and a base color
Before opening a generator, write a short example of each message your site needs to communicate. A success alert might confirm that a change was saved. A warning could ask someone to review information before continuing. An error might explain that a change could not be saved, while an informational alert could provide an update that needs no immediate action.
These examples give you something concrete to judge. Instead of asking whether four colors look attractive together, you can ask whether each one suits the message it will accompany and is distinguishable from the others.
Next, choose a starting color. If you have an existing site color, use it as an anchor for exploration. You might already have a color value to enter; if not, you can select a starting point visually and record the value you choose. If you are starting from scratch, pick a color that fits the overall impression you want and treat it as a working choice rather than a commitment.
Your starting color does not have to become an alert background. It can simply help guide your search for a set that feels at home alongside the rest of the site. Keep a note of the color and your four example messages so you can return to them while comparing options.
If an existing color seems too close to a possible alert color, make a note to review it in context. The question is whether a reader can understand the alert within the surrounding page, not whether the swatch looks appealing on its own.
Generate and refine candidate colors
Open the palette generator you intend to use and check which controls it offers. If it accepts a base color, enter or select the starting color you recorded. If it lets you choose a palette mode or the number of swatches, use those options to explore a manageable first set. You need candidates for four roles, although extra swatches can give you alternatives.
Generate a palette and record the color values that look promising. If the tool does not offer a particular control, you can still compare the swatches it produces and select another starting color when you need a different direction. Control names and available options may differ between generators, so follow the choices shown in the tool you are using.
Compare the set before assigning roles
Look at the candidates together. Are any two so similar that you would have trouble telling their intended roles apart? Does one feel out of place next to the site color? Keep the candidates that work well together and explore replacements for the ones that do not. If your generator allows individual changes, use that option; otherwise, generate another set and note useful candidates from each.
Try arranging your shortlisted colors beside the four example messages you wrote earlier. You are looking for a workable set, not a perfect answer from one generation. A color that seems suitable for a warning in isolation may feel too similar to your error candidate when both are displayed together.
Record the values for your preferred candidates and at least one alternative where you are uncertain. This gives you a way back if a later readability check or a review in context shows that a color needs to change.
Choose colors for each alert
Assign one candidate to each role: success, warning, error, and information. Think of each assignment as a small combination rather than a single swatch. Decide which color will appear behind the message and which color you intend to use for the text. If the alert includes an icon, note its color too.
A simple working table can keep those decisions visible:
| Alert role | Example message | Colors to record |
|---|---|---|
| Success | “Your changes were saved.” | Background, text, and any icon |
| Warning | “Review the details before continuing.” | Background, text, and any icon |
| Error | “Your changes could not be saved.” | Background, text, and any icon |
| Information | “There is an update to review.” | Background, text, and any icon |
Use your own messages if they better reflect the alerts you expect readers to see. The table is a planning aid: it keeps you from choosing four background colors and leaving the text decision until later.
Compare the roles as a group as well as one at a time. If your warning and error candidates are difficult to distinguish, try an alternative for one of them. If a candidate feels coordinated but makes the message hard to read, try a different text color or background and check the resulting pair.
You do not need to force the base color into every alert. Keep it as a reference point, and choose the individual combinations according to how well they serve their messages. Save the values you intend to use; you will need the exact pairs for the next step.
Check readability in context
Use a contrast checker to assess the actual text and background colors planned for each alert. Enter the text color and the background color for the same message, and note the result beside that alert in your working table. Repeat for all four roles rather than assuming that a text color will work equally well on every background.
For example, a reported warning color of #f59e0a has a contrast ratio of 2.15:1 against white. The reported ratio for #090a0c text on that same warning background is 9.22:1. The comparison illustrates why the pairing matters: changing the text color changes the result even when the background stays the same. These values are an example to learn from, not a substitute for checking your own choices.
If a result falls short of the requirement you are using, adjust the text or background and check the new pair. Keep a record of the revised values so the colors you eventually use match the colors you checked. If you also use a colored icon, review it against its actual background rather than assuming the text result applies to it.
Repeat for each theme
If your site has light and dark themes, list the combinations used in each. An alert may need different text or background values in each theme, so check every pair that will actually appear. Review the alert alongside its surrounding page as well: the message should be easy to find and read in the setting where someone encounters it.
When you change a color after checking it, repeat the check for each affected combination. A short record of role, theme, text value, background value, and result makes later revisions easier to follow.
Make each message clear without color
Give each alert a descriptive label or message so its meaning does not depend on recognizing a color. A word such as “Success,” “Warning,” “Error,” or “Information” can identify the role, while the rest of the message explains what happened and what the reader should do next. An icon can reinforce the message alongside the word and color.
For example, “Error: Your changes could not be saved. Check the details and try again” communicates more than an error-colored box alone. Likewise, “Success: Your changes were saved” tells a reader what succeeded. Adapt the wording to the situation, and avoid using a warning label for a message that does not explain what needs attention.
Review the four messages together without relying on their colors. Can you tell which one confirms an action, which asks for attention, which reports a problem, and which simply shares information? If two messages are ambiguous, revise their wording before treating the palette as finished.
Consider how the set appears to people who distinguish colors differently. If a simulation is available, use it as a quick preview to spot combinations you may want to revisit. A simulation does not replace testing with people, so seek feedback on both the colors and the clarity of the messages where you can.
Finish by reviewing each alert with its final wording, icon if used, text color, and background color in every relevant theme. Keep your recorded values and check results together so that a future change to one part of the alert prompts another look at the complete combination.