RGB Color Picker
Move the red, green and blue sliders from 0 to 255 and watch the color build up. The tool shows the rgb() value ready to paste into CSS, along with the matching hex, HSL and CMYK codes.
#2E8B57exactly seagreen
This is the CSS color seagreen #2E8B57
For example rgb(30, 144, 255) or 30 144 255
Use 3 or 6 digits, for example #1E90FF or 19F
For example hsl(210, 100%, 56%)
For example cmyk(88%, 44%, 0%, 0%)
Recent colors
Colors you pick appear here. They stay on this device.
By the Hex Color Picker Team. Updated
How to use the RGB color picker
- Drag the R, G and B sliders, or type a number from 0 to 255 for each channel.
- Already have a value? Paste rgb(46, 139, 87) or just 46 139 87 into the RGB box and the picker loads it.
- Use the color field above the sliders when you'd rather choose by eye, then fine-tune with the channels.
- Copy the rgb() string, or any other format, with the copy buttons.
How RGB color works
Screens make color by mixing red, green and blue light. Each channel is stored as a number from 0 (none of that light) to 255 (full strength), which gives 256 steps per channel and about 16.7 million combinations.
Equal amounts of all three channels produce grey: rgb(128, 128, 128) is mid-grey, rgb(0, 0, 0) is black and rgb(255, 255, 255) is white. Full red and full green with no blue gives yellow, rgb(255, 255, 0), which surprises people used to mixing paint.
Using rgb() in CSS
Modern CSS accepts both the comma form, rgb(46, 139, 87), and the space-separated form, rgb(46 139 87). This picker outputs the comma form because every browser and design tool still reads it. Opacity is a separate fourth value in CSS, for example rgb(46 139 87 / 50%). This tool covers opaque colors only.
A few reference values
- rgb(255, 165, 0) is the CSS color orange: full red, about two-thirds green, no blue.
- rgb(128, 0, 128) is purple, and rgb(0, 128, 128) is teal. Half strength on two channels gives these deeper tones.
- rgb(192, 192, 192) is silver and rgb(64, 64, 64) is a dark grey. Equal channels always give a grey.
- Raising the same amount on all three channels lightens a color without changing its balance, so rgb(60, 120, 200) becomes rgb(90, 150, 230) when you add 30 to each.
When RGB is the right format
Use RGB when you need to work with the channels directly: adjusting only the blue, matching a value from a screenshot analysis, or passing a color to canvas and image-processing code that expects 0-255 numbers. For lightening or darkening a color by hand, HSL is usually easier, and the HSL color picker is one click away.
Common questions
What is the RGB value for pure red, green and blue?
Red is rgb(255, 0, 0), green is rgb(0, 255, 0) and blue is rgb(0, 0, 255).
Why does the picker stop at 255?
Each channel is stored in 8 bits, which holds 256 values from 0 to 255. Values outside that range aren't valid in standard sRGB CSS colors.