NinjaFunction (Ninja Function) logo

Color Picker & Generator

Color palette generator with conversion tools.


About This Tool

Our free online tool helps you pick, convert, and generate colors for your design and development projects. Easily switch between HEX and RGB formats, copy color codes, and create beautiful color schemes.

🔑 How to Use

🔹 Pick or Generate Colors

Use the color picker to select any color visually

Click "Random" to generate a random color

The color preview updates instantly

🔹 Convert Color Formats

Type HEX values (e.g., #FF5733 or FF5733)

Type RGB values (e.g., rgb(255, 87, 51))

The tool automatically converts between formats

Click the copy icon to save color codes

🔧 Features


💡 Pro Tips

  • ✔ Press "Random" multiple times to quickly explore different color schemes.
  • ✔ Combine complementary colors by picking one color and using its opposite on the color wheel.
  • ✔ Use the HEX/RGB conversion to switch between web and design formats instantly.
  • ✔ Test accessibility by checking your color contrast ratios before implementation.
  • ✔ Bookmark colors by copying codes to your design system documentation.

HEX vs RGB vs HSL: Which Colour Format to Use

The same colour can be written in several formats. This tool converts between HEX and RGB, the two formats you will use most in web development and design tools.

FormatExample (orange)Best for
HEX#FF5733CSS, HTML and design handoff. Short and easy to copy.
RGBrgb(255, 87, 51)Code that changes colours, and rgba() when you need transparency.
HSLhsl(11, 100%, 60%)Building themes, because you can change lightness without changing the hue.

A HEX code is simply the RGB values written in base 16: FF = 255 red, 57 = 87 green and 33 = 51 blue. That is why the two formats always convert exactly, with no loss of colour.

Choosing Accessible Colours

A colour that looks good is not always easy to read. The Web Content Accessibility Guidelines (WCAG) recommend a contrast ratio of at least 4.5:1 between normal text and its background, and 3:1 for large text.

  • Avoid light grey text on a white background, and pure red text on green.
  • Do not use colour alone to show meaning, such as errors. Add an icon or text as well.
  • Test your main text, button and link colours in both light and dark themes.

Need a full palette? Create lighter and darker versions of your colour with the Color Shades Generator, or blend two colours with the CSS Gradient Generator.

A Worked Example

Take the colour #1C5C52, a dark teal. Split the code into pairs and read each pair as a base-16 number: 1C is 1 × 16 + 12 = 28, 5C is 5 × 16 + 12 = 92 and 52 is 5 × 16 + 2 = 82. So the same colour in RGB is rgb(28, 92, 82), which is exactly what the tool shows. Going the other way, 28 in base 16 is 1C, 92 is 5C and 82 is 52.

In HSL the same teal is about hsl(171, 53%, 24%). The low lightness, 24%, is why it reads as dark. Raise the lightness to around 70% and keep the hue and saturation, and you get a soft mint from the same family.

Common Mistakes

  • Leaving out the #. In CSS, a HEX colour needs the # in front, as in #1C5C52.
  • Mixing up shorthand. #FA3 is shorthand for #FFAA33, with each digit doubled. It is not the same as #FA3000.
  • Matching colours by eye on one screen. Screens show colours differently. Copy the exact code instead of picking a colour from a screenshot of another device.
  • Forgetting contrast. A colour that looks good as a background may make text hard to read. Check text and background together with the Color Contrast Checker.

Frequently Asked Questions

How do I convert HEX to RGB?

Type or paste a HEX code such as #FF5733 into the HEX field. The RGB value, rgb(255, 87, 51), appears instantly. It also works the other way round: type an RGB value to get its HEX code.

Do I need to type the # symbol?

No. You can enter a HEX code with or without the #, for example FF5733 or #FF5733. Three-digit short codes such as #F53 also work.

What is a HEX colour code?

A HEX code is a six-digit code that describes a colour using red, green and blue values written in base 16. Each pair of digits goes from 00 (none) to FF (full), so #000000 is black and #FFFFFF is white.

What is the difference between RGB and HSL?

RGB describes a colour by how much red, green and blue light it contains. HSL describes it by hue (the colour on the colour wheel), saturation (how strong it is) and lightness. HSL is easier when you want a lighter or darker version of the same colour.

How do I use the colour code in CSS?

Click the copy icon next to the HEX value and paste it into your CSS, for example color: #FF5733; or background-color: rgb(255, 87, 51);. Both formats are supported by every modern browser.

Is the colour picker free to use?

Yes. The tool is free, needs no sign-up and runs in your browser, so it also works on phones and tablets.

Always FreeAll tools are 100% free to use.
No Sign UpNo registration or login required.
Blazing FastInstant results, always.