Color Picker & Palette Generator

Create a five-step palette from an anchor color

A color system often begins with one promising swatch rather than a complete set of interface colors. A brand review might supply one approved accent, a product mockup might settle on one button color, or a developer might receive a hex value without its hover, border, surface, and focus-state companions. This color picker turns that starting point into a compact five-swatch palette. Select one base color and the tool supplies darker and lighter relatives from the same HSL color family.

The palette generator is deliberately focused: choose a base color, press Generate Palette, and review five hex swatches arranged from dark to light. It is not trying to create every harmony type or a complete design-token library. Instead, it provides a consistent first tonal scale from one anchor color. When a row looks promising, save it on the page and compare it with another candidate before choosing a direction.

That makes this color tool useful during both design and implementation. Designers can see whether an anchor color has enough tonal range for a small interface scale. Developers can copy exact hex codes into CSS variables or component themes. Teams can place candidate palettes beside one another without opening a larger graphics application. The result is a structured set of related colors that is easier to evaluate and reuse than one isolated swatch.

How this HSL palette generator changes your base color

This palette generator needs only a base color. Rather than accepting rates, costs, or physical measurements, it reads a browser color-picker value such as #3366cc. On generation, the script converts that hex value to HSL: hue, saturation, and lightness. It keeps the hue and saturation unchanged, then moves lightness in even increments above and below the original color.

That approach is why the generated swatches generally look connected. Hue represents the broad color family, saturation describes intensity, and lightness makes a color appear darker or brighter. Adjusting the lightness dimension while retaining the original hue and saturation yields shades and tints that continue to read as one family. The darkest positions may suit stronger emphasis or outlines, middle positions may work for primary UI elements, and lighter positions may be useful for surfaces or highlights.

The color picker also has clear limits. It does not test text contrast, create complementary schemes, or guarantee accessibility for a particular foreground and background pair. It produces a five-step tonal range from one base color. Use that range as a practical starting point, then assess every intended combination in the interface where it will appear.

Using the color picker and palette controls

To use this color palette generator, begin with the color that should occupy the center of the range. Choose an existing brand color when you have one, or explore a hue that matches the mood of the project. Press Generate Palette to display five hex swatches from darker to lighter. The result message lists the generated codes, while the visible swatches provide the quicker visual check.

Save Palette supports on-page comparison rather than export. It leaves the current five-swatch row visible lower on the page while you select and generate another base color. This is useful when two similar choices in the picker produce noticeably different dark and light extremes after expansion into a tonal range.

A practical color-palette workflow is:

  • Choose a candidate anchor color for the middle of the five swatches.
  • Generate the row and check whether its darkest and lightest positions remain useful rather than muddy or washed out.
  • Click any swatch to copy its hex code for CSS, a design-token file, or a mockup.
  • Save a good row before trying another base color so both palettes remain available for comparison.

Because the input is a color rather than a measured quantity, visual judgment is the important check. Look for enough separation between steps to support the roles you need. If the outer swatches are too extreme, adjust the base color. If the middle swatches appear nearly identical, the chosen color may already be too close to black, white, or neutral gray for a broad five-step lightness range.

The five HSL lightness steps behind each palette

This color picker performs a specific HSL transformation rather than a generic calculator operation. After converting the selected hex color to hue H, saturation S, and lightness L, it creates five outputs. Hue and saturation remain fixed for every output; only lightness changes. The five positions correspond to offsets of -0.2, -0.1, 0, +0.1, and +0.2 from the selected color's original lightness.

The script limits every calculated lightness value to the valid HSL interval from 0 to 1. In practical terms, each adjacent position is 10 lightness percentage points darker or lighter than its neighbor until it reaches black or white. This is a simple, repeatable tonal adjustment, not a blend or an average of unrelated colors.

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

For a base color near the middle of the lightness range, this produces two darker swatches, the original color, and two lighter swatches. A very dark or very light base can cause the outer positions to compress at 0 or 1. Similar or repeated outputs in that situation are expected: they show that the requested lightness step has reached the boundary of the HSL scale.

Palette example using a pure-red base color

With #ff0000 as the base color, the palette generator begins with HSL lightness of 0.5. It preserves red hue and full saturation while applying the five lightness offsets. The resulting row is #990000, #cc0000, #ff0000, #ff3333, and #ff6666, ordered from darker to lighter. This example shows the exact effect of the generator's 0.1 lightness steps around a mid-range base.

The resulting red scale offers distinct tonal roles, not random variations. A darker red may help anchor an outline or pressed state, the center swatch remains the reference red, and lighter reds can provide softer fills or notification surfaces. Whether those uses are appropriate still depends on surrounding colors and contrast, but the row gives a consistent starting hierarchy.

Palette position Relative role Typical use
Swatch 1 Darkest step Strong outlines, pressed states, or emphasis where a deeper version of the family is useful.
Swatch 2 Darker support Secondary controls, chips, tags, or icon accents that should be slightly heavier than the base.
Swatch 3 Base color The original reference tone and often the primary brand expression.
Swatch 4 Lighter support Softer callouts, decorative highlights, or areas where the base color would feel too intense.
Swatch 5 Lightest step Background washes, subtle panels, and low-pressure emphasis within the same family.

If the pure-red example is too intense for a project, choose a more muted or darker red as the base color and regenerate the palette. The algorithm will still preserve that new hue and saturation while placing the five outputs around its lightness value.

Reading generated swatches and comparing saved palette rows

The generated-palette area converts the HSL calculation into codes you can reuse. After a color is generated, the live message identifies the selected base color and lists the five hex values in dark-to-light order. Click a visible swatch to copy its hex code, then paste it into CSS custom properties, a Sass map, a design-token file, or project notes.

The saved-palette area is for comparing tonal behavior across base colors. It retains previous rows while you test new candidates, making it easier to spot a color that looks appealing alone but produces weak light steps or overly heavy dark steps. Side-by-side rows help answer a more useful question than whether one swatch is attractive: which anchor color creates the most workable five-step range?

Saving is intentionally lightweight. The row remains available on the current page for comparison, but it is not permanent storage or a server-backed palette library. Copy important hex codes into your own design or implementation records if you need to retain them after the session.

Limits of this lightness-based palette tool

This color palette generator is intentionally narrow: it makes related HSL lightness variants quickly. That focus is useful for exploration, but it does not replace contrast checking, perceptual color-space work, or semantic color decisions for a production interface.

  • Near-black and near-white inputs can compress. Lightness is clamped, so extreme base colors can produce repeated or barely distinguishable outer swatches.
  • Low-saturation inputs remain low saturation. A near-gray base produces a near-gray palette because the generator preserves saturation rather than inventing colorfulness.
  • Contrast is not guaranteed. A visually appealing swatch can still be unsuitable for text against a particular background.
  • Save Palette is page-level comparison. It does not upload rows or guarantee persistence after refresh.
  • The output is a tonal helper, not a complete brand system. A full system may also require neutrals, semantic status colors, complementary colors, typography, and spacing rules.

Used with those limitations in mind, the tool is a fast way to build related shades, compare candidate anchors, and capture consistent hex values during design or development. Its value is the transparent transformation from one selected color to a small tonal scale.

What this color palette generator is designed to answer

This page answers one focused color question: โ€œIf this is my anchor color, which darker and lighter neighbors remain in the same HSL family?โ€ You select the center point, the generator applies controlled lightness offsets, and you decide whether the resulting spread works for the interface. That direct model makes the output easier to interpret than a collection of unrelated suggested colors.

The optional palette-sorting mini-game below uses the same dark-to-light relationship. It asks you to match falling shades to the appropriate palette slot, reinforcing how measured lightness changes create structure within 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 HSL lightness palette

Your five generated 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 color palettes for side-by-side review

Saved color rows remain visible here while you compare several base-color choices on this page.

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

Color palette 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 | Five HSL Lightness Swatches to your website.