Designer

Button Color Generator

Generate hover, active, focus, and disabled button colors with accessible text.

Designer

Why Use the Button Color Generator?

A single brand color is only the starting point for a button, and this button color generator fills in the rest of the states for you. From one base color it creates the default, a darker hover, an even darker active state, a semi-transparent focus ring and a disabled style. It also picks white or near-black label text based on contrast and shows the contrast ratio, so designers and developers can ship consistent, accessible buttons without guessing at hover shades.

How to Use the Button Color Generator

  1. Enter your base button color with the picker or by typing a HEX, rgb(), hsl() or CSS color name value.
  2. Review the default, hover, active, focus and disabled previews to make sure each state is clearly different from the one before it.
  3. Check the automatically chosen text color and the contrast ratio shown; if the ratio is below 4.5:1, try a slightly darker or lighter base color.
  4. Click Copy on the CSS output and paste the state rules into your button component or stylesheet.

Best For

  • Setting up primary button styles for a design system or component library from a brand color.
  • Adding consistent hover and active feedback to call-to-action buttons on a landing page.
  • Giving keyboard users a visible, on-brand focus ring that does not rely on the default browser outline.
  • Creating a clearly inactive disabled style for form submit buttons while required fields are empty.

Pro Tip

Attach the focus ring to the :focus-visible selector rather than :focus, so keyboard users always see it while mouse clicks do not leave a ring behind. If the generator switches between white and near-black text as you nudge the base color, your color is sitting near the middle of the lightness range; move it clearly darker or lighter so the label stays legible and the brand look stays stable. Keep the hover change small but noticeable, because large jumps can feel like a different button.

FAQ

Button Color Generator FAQ

What color should a button hover state be?

A common approach is to make the hover state slightly darker than the default on light themes, which signals interactivity without changing the brand color. The active or pressed state is usually a step darker still. On dark themes, lightening the button on hover often reads better than darkening it.

How do I make button colors accessible?

The button label needs at least 4.5:1 contrast against the button background, or 3:1 if the label is large text. WCAG also asks for 3:1 contrast for visual cues needed to identify a control and for focus indicators. Check every state, including hover and focus, not only the default.

Do disabled buttons need to meet contrast requirements?

No, WCAG exempts inactive interface components from its contrast requirements, so disabled buttons may look faded. Still, users should be able to tell that the button exists and why it is unavailable. Pair a muted disabled style with helper text that explains what needs to happen before the button becomes active.

What is a focus ring on a button?

A focus ring is the visible outline that shows which element currently has keyboard focus. People who navigate with a keyboard or switch device rely on it to know where they are on the page. Never remove the outline without replacing it with a clearly visible ring, such as the semi-transparent ring this tool generates.

Learn more

Guides for the Button Color Generator

How to Use Pastel Colors in Modern Design Without Looking Washed Out

Learn how to use pastel colors in web design without a washed-out look: the HSL values behind pastels, contrast-safe text pairings, and ready-made palettes.

Read Guide

The 60-30-10 Color Rule: A Simple Formula for Balanced Designs

Learn the 60-30-10 color rule for web design: how to split color across backgrounds, secondary areas and accents, with HEX examples, CSS and dark mode tips.

Read Guide
Copied