Generators
By ToolzBank Team•
2 min read
•Sunday, August 31, 2025•Updated Friday, November 13, 2026

How Color Codes Work and How to Generate Perfect Palettes

HEX codes, RGB values, HSL — colors in design have multiple formats. Here is how they all relate and how to generate harmonious color palettes.

The Three Ways Colors Are Written in Code

HEX codes: A six-character code starting with a hash. #FF5733 is a shade of red-orange. The first two characters represent red intensity, the next two represent green, and the last two represent blue. Each pair ranges from 00 (none) to FF (maximum).

If you'd like to follow along, open ToolzBank's free color code generator in another tab. There's nothing to install and no account to create.

RGB: Three numbers from 0-255 for Red, Green, and Blue. The same color above would be RGB(255, 87, 51). It is the same information as HEX, just written differently.

HSL: Hue (0-360 degrees on a color wheel), Saturation (0-100%), and Lightness (0-100%). This format is more intuitive for designers because adjusting saturation or lightness is straightforward. The same color: HSL(9, 100%, 60%).

How Color Palettes Work

A color palette is a set of colors that work well together. Color theory defines several harmony types:

  • Complementary: Two colors opposite each other on the color wheel. High contrast, visually striking.
  • Analogous: Colors next to each other on the wheel. Harmonious and pleating, low contrast.
  • Triadic: Three colors evenly spaced around the wheel. Vibrant and balanced.
  • Split-complementary: A color plus the two colors adjacent to its complement. High contrast but less jarring than complementary.

How to Generate a Color Palette

Step 1: Choose a base color (your brand color or starting point). Step 2: Select a harmony type (complementary, analogous, etc.). Step 3: The generator creates a full palette based on color theory. Step 4: Adjust individual colors if needed. Step 5: Copy the HEX codes for use in your designs.

Tips

  • Limit your palette to 3-5 colors for most designs. More than that becomes chaotic.
  • Always test your colors for accessibility — make sure text is readable against its background. Dark text on light backgrounds (or vice versa) with sufficient contrast is essential.