Color Picker & Palette Generator

Build a usable palette from one starting color

Color work usually begins with a single promising swatch, not a finished system. A brand review might hand you one approved accent color. A product mockup might start with one button color that feels right. A developer may copy a hex value from a design file and then realize that one isolated color is not enough to build hover states, borders, muted backgrounds, cards, badges, and focus rings. This tool bridges that gap. Instead of asking you to calculate shades by hand, it starts from one base color and creates a compact five-step palette you can use immediately.

The page is intentionally simple: you choose a base color with the color picker, press Generate Palette, and the tool returns five related hex swatches arranged from darker to lighter. The idea is not to produce every possible harmony rule or an entire design token system in one click. The goal is to give you a dependable first pass that stays visually cohesive because the generated colors come from the same underlying hue family. If you like the result, you can save that row on the page and compare it with another option before committing.

This makes the calculator useful for both design and implementation work. Designers can quickly test whether a color has enough room above and below it for a workable interface scale. Developers can copy exact hex codes for CSS variables or component themes. Teams can compare several candidate brand colors side by side without opening a larger graphics application. In short, the tool turns one color choice into a small, structured palette that is easier to discuss and easier to use.

What the tool actually calculates

The only required input is the base color. Unlike calculators that ask for rates, costs, or physical units, this one asks for a hex color value. The input field is a standard browser color picker, so you can choose visually or paste a known color like #3366cc. When you run the generator, the script converts that hex value into HSL: hue, saturation, and lightness. The palette is then created by holding hue and saturation steady while shifting lightness in equal steps around the original value.

That detail matters because it explains why the output feels coherent. Hue identifies the basic color family, saturation controls how intense or muted the color feels, and lightness controls how dark or bright it appears. By changing mostly the lightness dimension, the generator produces shades and tints that still look like they belong together. In practice, that often gives you a darkest swatch for outlines or strong emphasis, a couple of middle swatches for primary interface elements, and lighter swatches for surfaces, highlights, or backgrounds.

It also clarifies what the tool does not do. It does not automatically measure contrast against white or black text, generate complementary palettes, or guarantee brand accessibility in every context. It gives you a clean five-step tonal range from one base color. That is a very practical building block, but it is still a building block. After you generate the palette, you should judge how each swatch behaves in the interface where you plan to use it.

How to use the form without guessing

Using the form is straightforward, but a little interpretation helps you get better results. Start by choosing the color that should sit near the center of your palette. If you already have a brand color, use that. If you are exploring, pick the swatch that best captures the mood you want: calm, energetic, premium, playful, or neutral. Then press Generate Palette. The result area will summarize the five hex codes, and the swatches below it will appear from darker to lighter.

The Save Palette button is for comparison, not export. It keeps the current five-swatch row visible lower on the page so that you can try another base color and judge the two sets side by side. That is especially handy when two hues feel close in the picker but behave differently once they are expanded into a full mini-palette. If you are deciding between, say, a warmer blue and a cooler blue, the saved rows make the tradeoff visible immediately.

A good workflow is usually this:

  • Choose a candidate base color that should represent the center of the palette.
  • Generate the five swatches and check whether the darkest and lightest steps are still useful, not muddy or washed out.
  • Click any swatch to copy its hex code if you want to test it in CSS, a design token file, or a mockup.
  • Save the palette if you want to compare it with another candidate on the same page.

Because the input is a color rather than a measured unit, the main sanity check is visual. Ask whether the range is wide enough for your needs. If the outer swatches look too extreme, pick a different base color. If the middle colors all feel too similar, your chosen hue may already be too close to black, white, or gray for a five-step scale to breathe.

How the formula works

The page already includes the general idea behind calculators: an output is a function of one or more inputs. That broad framing still applies here. The result depends on the base color, and the palette generation routine transforms that one input into several related outputs. The generic notation below is preserved because it accurately describes the structure of the tool: the final palette is determined by a repeatable function applied to your selected value.

R = f ( x1 , x2 , โ€ฆ , xn )

Many calculators also combine several contributions into a total. In this palette generator, the swatches are not added together to make one numeric total, but the same mathematical mindset helps: each palette position is a controlled variation of the base color, and together those positions form the usable output set.

T = โˆ‘ i=1 n wi ยท xi

For this specific tool, the practical formula is easier to describe in plain language. First, convert the chosen hex color into HSL values H, S, and L. Next, build five swatches by keeping H and S fixed and replacing lightness with values centered on the original lightness. The script uses steps of 0.1 in lightness, which means 10 percentage points darker or lighter for each neighboring swatch. The result is clamped so it never drops below 0 or rises above 1.

Li = clamp ( L + 0.1 ยท i , 0 , 1 ) for i โˆˆ {โˆ’2,โˆ’1,0,1,2}

That one line captures the entire generator. If your base color sits in the middle of the lightness range, the palette expands smoothly in both directions. If the base color begins very dark or very light, the clamping step can compress the outer swatches. That is why some near-black or near-white starting colors may produce two very similar outputs. The algorithm is still behaving correctly; you are simply running into the natural limits of the lightness scale.

Worked example: starting with pure red

Suppose your base color is #ff0000. In HSL terms, that is a vivid red with a lightness around 0.5. The generator keeps the same hue and saturation, then creates four neighbors around it by shifting lightness down and up in 0.1 steps. A representative result is a palette close to #990000, #cc0000, #ff0000, #ff3333, and #ff6666. Those exact hex values can differ by a rounding step, but the pattern remains the same: two darker reds, the original red, and two lighter reds.

That gives you more than decorative variety. The darkest red could serve as a border, active state, or chart accent. The middle red may remain your primary action color. The lightest red can become a subtle background tint, a hover fill, or a soft notification surface. In other words, the tool is not merely making random relatives. It is creating a tonal ladder that is easier to apply consistently across interface states and content hierarchy.

Palette position Relative role Typical use
Swatch 1 Darkest step Strong outlines, pressed states, emphasis where a deeper tone helps anchor the color family.
Swatch 2 Darker support Secondary buttons, chips, tags, or icon accents that should feel close to the main color but slightly heavier.
Swatch 3 Base color Primary brand expression, the reference tone you started with, and often the most recognizable swatch.
Swatch 4 Lighter support Hover fills, softer callouts, decorative highlights, or large UI areas where the base color would feel too intense.
Swatch 5 Lightest step Background washes, subtle panels, and low-pressure emphasis that still belongs to the same palette.

If the worked example feels too harsh or too saturated for your project, that is not a flaw in the math. It simply means pure red may not be the best center point for your interface. A slightly muted or darker starting red will usually generate a more versatile set of swatches.

How to interpret the result area and saved palettes

The result area is there to translate the visual output into something easy to reuse. After generation, it reports the selected base color and the sequence of hex codes produced by the algorithm. That text is useful when you want to quickly confirm that the palette changed in the direction you expected. If you move from a cooler blue to a greener blue, the summary helps you verify that you are not mentally blending two similar-looking options.

Each generated swatch is also clickable. When you click a swatch, the page copies its hex code so you can paste it into CSS custom properties, a Sass map, a design token file, a Figma note, or a handoff document. That simple interaction reduces friction because you do not have to manually retype the code from memory or inspect the page source. The tool becomes a working bridge between visual choice and implementation detail.

The saved palette area serves a different purpose: comparison. It keeps prior rows visible while you test new starting colors. This is useful when the decision is not merely, “Do I like this color?” but rather, “Which starting color creates the most flexible tonal scale?” Sometimes a base swatch looks attractive on its own but produces muddy dark steps or weak light steps. Side-by-side saved rows reveal that immediately.

One important practical note: saving on this page is lightweight. It preserves the row in the current page session so that you can compare ideas, but it is not a database and not a permanent storage system. If you want to keep a palette for later, copy the hex codes into your project notes or implementation files. The page makes exploration fast; your own workflow should handle long-term storage and versioning.

Assumptions and limitations you should know

This generator is intentionally narrow. That is a strength when you want a fast answer, but it also means you should know the boundaries of the model. The palette is built by shifting lightness, not by optimizing contrast, accounting for perceptual color spaces, or testing semantic usage in a real interface. Those extra steps still matter for production work, especially in accessibility-sensitive components.

  • Near-black and near-white inputs can compress. Because lightness is clamped, extreme starting colors may produce repeated or barely distinguishable outer swatches.
  • Very low saturation stays very low saturation. If your base color is nearly gray, the palette will stay nearly gray. That is expected because the generator is preserving the family, not inventing saturation.
  • Contrast is not guaranteed. A swatch that looks attractive may still fail text contrast requirements against a chosen foreground or background.
  • Save Palette is page-level comparison. It does not upload to a server or promise persistence after a refresh.
  • The result is a tonal helper, not a full brand system. You may still want complementary colors, neutrals, semantic status colors, and spacing or typography rules around the palette.

If you keep those assumptions in mind, the output becomes much easier to trust. The tool is best used as a quick generator for related shades, a comparison surface for candidate base colors, and a practical shortcut for grabbing consistent hex codes during design or development. It is not pretending to replace an entire color strategy. It is giving you a fast, transparent first layer of one.

A short way to think about the page as a whole

At a high level, this calculator is answering a focused question: “If this is my anchor color, what darker and lighter neighbors can I use without leaving the same color family?” That is why the interaction is so compact. You are not entering several independent variables. You are choosing a center point, letting the algorithm fan outward in controlled lightness steps, and then judging whether the resulting tonal spread is practical for your interface. That mental model makes the output easier to interpret and much more useful than a page that simply throws out random related swatches.

If you want to reinforce that idea in a playful way, the mini-game below turns the same concept into a quick challenge. It uses your current base color and asks you to sort falling shades into the correct palette slot. The goal is not just entertainment; it helps your eye notice how small lightness changes create structure inside one hue family.

Palette controls

Choose the anchor color for the palette. The generator will create five related swatches by stepping the color darker and lighter around this base.

Choose a base color and generate a five-swatch palette. The live message also reports copied hex codes and save status.

Generated palette

Swatches appear here from darker to lighter. Click a swatch to copy its hex code.

Generate a palette to preview five related shades here.

Saved palettes for comparison

Saved rows remain on this page so you can compare multiple base-color choices without losing the previous result.

No palettes saved yet. Generate one you like and then save it here.

Mini-game: Palette Sorter Sprint

This optional canvas mini-game uses your current base color. Click to play, then tap or press keys 1 through 5 to send each falling chip into the matching palette slot as it crosses the glowing scoring band. Ignore glitch chips that do not belong to the palette. The pace rises every few waves, so accuracy and streak control matter as much as speed.

Score: 0 Time: 75 Streak: 0 Lives: 5 Wave: 1

Palette Sorter Sprint

Click to play. Your chosen base color becomes five palette slots from dark to light. Tap the matching slot when a chip reaches the scoring band, ignore glitch colors, and build a streak before time runs out.

Best score: 0

No run yet. The educational takeaway is simple: cohesive palettes often come from keeping one hue family steady while changing lightness in measured steps. Best score: 0.

Embed this calculator

Copy and paste the HTML below to add the Color Picker & Palette Generator Tool | Build Five-Step Color Palettes to your website.