Image Converters टूल अपडेट किया गया 3 दिन पहले

Hex and RGB Color Picker & Converter

Pick a colour or type a hex code and instantly see it as HEX, RGB and HSL, with sliders for every channel and one-click copy buttons for CSS-ready values. The tool also shows contrast ratios against white and black with a WCAG rating, and generates complementary, analogous, triadic and split complementary harmonies. Everything runs in your browser.

Color Picker HEX Color RGB Converter Copy Color

उपयोग करें Hex and RGB Color Picker & Converter

रंग चयनकर्ता और कनवर्टर

HEX और RGB के बीच रूपांतरण करें और रंगों को सहजता से चुनें।

एक रंग चुनें
—
—
WCAG AA
हाल के रंग
अभी तक कोई रंग सहेजा नहीं गया है
हेक्स रंग
#
आरजीबी रंग
rgb( )

R
G
B
एचएसएल रंग
hsl( )
H
S
L
रंग सामंजस्य
पूरक
तुल्य
त्रिआधारी
विभाजित पूरक
टूल लिंक
क्लिपबोर्ड पर कॉपी हो गया।
इस उपकरण को बेहतर बनाने में मदद करें
140
उपयोग किया गया समय
138
कुल उपयोगकर्ता
5+ वर्ष
परोसा गया
अंतिम समीक्षा 2 सप्ताह पहले. में की गई थी। उपयोग संख्याएँ आवधिक ऑडिट के दौरान ताज़ा की जाती हैं। (से रिपोर्टिंग21 Feb 2022)
अनुपालनहीनता की रिपोर्ट करें

सामग्री पढ़ें

जानें कि यह उपकरण कैसे काम करता है और इसका उपयोग कब करना है।

One Colour, Three Notations, Instantly in Sync

The Hex and RGB Color Picker and Converter keeps a single colour in view and shows it at the same time as a HEX code, an RGB triplet and an HSL value. Change it in any one place, whether by typing a hex code, dragging an RGB slider, nudging hue or lightness, or choosing a colour from your system's picker, and every other field, the large preview swatch, the contrast scores and the colour harmony swatches update at once. It is built for web designers, front-end developers, students learning CSS colour, and anyone who has a colour in one format and needs it in another.

Everything runs in your browser with plain JavaScript. No colour values are sent to a server, and the page works as soon as it has loaded.

What Is on the Page

Preview and picker

The left column holds a large preview of the current colour and a Pick a Color button. That button opens your browser's or operating system's native colour chooser, so its look depends on whether you are on Windows, macOS, Android or iOS. Whatever you choose there becomes the current colour.

Contrast and accessibility

Below the preview are two contrast badges. One shows the contrast ratio of the current colour against pure white, the other against pure black, each to two decimal places. A third badge gives a WCAG rating based on the better of those two ratios.

HEX Color card

A text field for the six-digit hex code, with two copy buttons: Copy HEX copies the code without a hash (for example 4263EB) and Copy with # copies it ready for CSS (#4263EB).

RGB Color card

Shows the colour as rgb( 66, 99, 235 ) with three sliders labelled R, G and B, each paired with a number box that accepts 0 to 255. Copy RGB copies the bare numbers (66, 99, 235) and Copy rgb() function copies rgb(66, 99, 235).

HSL Color card

Shows the same colour as hue, saturation and lightness, with H (0 to 360), S (0 to 100) and L (0 to 100) sliders and number boxes. Copy hsl() function copies a string like hsl(228, 81%, 59%).

Color Harmonies

Four rows of swatches generated from the current colour's hue: Complementary, Analogous, Triadic and Split Complementary. Hovering a swatch shows its hex code, and clicking it makes that swatch the current colour.

Theme toggle

A moon or sun button in the corner switches the page between light and dark appearance, which is useful for judging how a colour looks on each background.

How to Convert HEX to RGB

  1. Click into the HEX Color field and clear it.
  2. Type the six hex digits without the hash, for example FF8800. The field holds six characters, so pasting a value with a leading # cuts off the last digit; paste or type the code without it.
  3. As soon as six valid digits are present, the RGB card shows the matching values, here 255, 136, 0, and the preview updates.
  4. Click Copy rgb() function to copy rgb(255, 136, 0).

Three-digit shorthand also works. Type F80 and click or tab out of the field; on leaving the field it is expanded to FF8800. If what you typed is neither three nor six valid hex digits when you leave the field, it reverts to the current colour's code.

How to Convert RGB to HEX

  1. Drag the R, G and B sliders, or type values from 0 to 255 into the number boxes beside them.
  2. The HEX field updates live in upper case.
  3. Click Copy with # to copy the CSS-ready code.

Note that the rgb( ... ) text line at the top of the RGB card is a display of the current value; to change the colour, use the sliders or the number boxes.

Working with HSL

HSL is often easier for adjusting a colour than RGB. To make a button colour lighter for a hover state, keep H and S and raise L by 8 to 10. To make a muted version for a background, lower S. Each change in the HSL card instantly recalculates the HEX and RGB values. Because the HSL fields hold whole numbers, converting a colour to HSL and back can occasionally shift an RGB channel by one step; for an exact colour, copy the HEX or RGB value.

The Maths in Brief

A hex code is three pairs of base-16 digits, one each for red, green and blue. Each pair runs from 00 (0) to FF (255). Taking the tool's starting colour #4263EB as an example:

ChannelHex pairCalculationDecimal
Red424 x 16 + 266
Green636 x 16 + 399
BlueEB14 x 16 + 11235

So #4263EB equals rgb(66, 99, 235), which the tool shows as hsl(228, 81%, 59%). Going the other way, each decimal value is divided by 16: the whole part is the first hex digit and the remainder is the second.

Understanding the Contrast Badges

The contrast ratio uses the WCAG relative luminance formula and ranges from 1 (no contrast) to 21 (black on white). The rating badge applies these thresholds to the higher of the two ratios:

BadgeRatioMeaning
WCAG AAA7 or moreMeets the enhanced level for normal text
WCAG AA4.5 or moreMeets the minimum for normal body text
WCAG AA Large3 or moreAcceptable for large or bold text only
WCAG Failbelow 3Too low against both white and black

Because the rating uses whichever of white or black scores better, read the individual badges to see which pairing actually passes. The tool only measures against pure white and pure black; to check two custom colours against each other, you need a dedicated contrast checker.

Common Named Colours

These standard CSS colour keywords are handy reference points. Type any of the hex codes into the tool to see them, their contrast scores and their harmonies.

Color NameHex ColorRGB ColorHSL
Black#000000rgb(0,0,0)hsl(0, 0%, 0%)
White#FFFFFFrgb(255,255,255)hsl(0, 0%, 100%)
Red#FF0000rgb(255,0,0)hsl(0, 100%, 50%)
Lime#00FF00rgb(0,255,0)hsl(120, 100%, 50%)
Blue#0000FFrgb(0,0,255)hsl(240, 100%, 50%)
Yellow#FFFF00rgb(255,255,0)hsl(60, 100%, 50%)
Cyan / Aqua#00FFFFrgb(0,255,255)hsl(180, 100%, 50%)
Magenta / Fuchsia#FF00FFrgb(255,0,255)hsl(300, 100%, 50%)
Silver#C0C0C0rgb(192,192,192)hsl(0, 0%, 75%)
Gray#808080rgb(128,128,128)hsl(0, 0%, 50%)
Maroon#800000rgb(128,0,0)hsl(0, 100%, 25%)
Olive#808000rgb(128,128,0)hsl(60, 100%, 25%)
Green#008000rgb(0,128,0)hsl(120, 100%, 25%)
Purple#800080rgb(128,0,128)hsl(300, 100%, 25%)
Teal#008080rgb(0,128,128)hsl(180, 100%, 25%)
Navy#000080rgb(0,0,128)hsl(240, 100%, 25%)

Building a Palette with Harmonies

The harmony rows rotate the hue of the current colour while keeping its saturation and lightness:

  • Complementary: the current colour and the hue opposite it (plus 180 degrees). Strong contrast for call-to-action accents.
  • Analogous: hues 30 degrees either side of the current colour. Calm, cohesive schemes.
  • Triadic: three hues spaced 120 degrees apart. Lively but balanced.
  • Split Complementary: the current colour plus the two hues 150 and 210 degrees away. Contrast with less tension than a straight complement.

Click any swatch to adopt it, read its codes, and copy what you need. Clicking through harmonies is a quick way to explore a scheme around a brand colour.

Tips

  • Use Copy with # for CSS, SCSS and Tailwind arbitrary values; use Copy HEX for design tools that want the digits only.
  • Check both contrast badges before choosing a text colour for a coloured background.
  • Switch the page theme to preview a colour on light and dark surfaces.
  • Adjust lightness in the HSL card to create consistent tints and shades of one hue.

Things to Avoid

  • Pasting #RRGGBB into the HEX field: the seven characters are trimmed to six, so the value is cut off. Paste just the digits.
  • Typing into the rgb( ) or hsl( ) text lines and expecting the colour to change; use the sliders or number boxes.
  • Treating the WCAG badge as a full accessibility audit; it measures contrast against black and white only.

Limitations

  • No alpha channel: RGBA, HSLA and eight-digit hex codes are not supported.
  • Only HEX, RGB and HSL are shown; there is no CMYK, HSV or Pantone conversion.
  • HSL values are whole numbers, so round trips through HSL can be off by one in an RGB channel.
  • Contrast is measured against white and black only.
  • The native picker's appearance and features depend on your browser and operating system.

Frequently Asked Questions

अक्सर पूछे जाने वाले प्रश्न

परिणाम पर भरोसा करने से पहले उपयोगकर्ताओं द्वारा पूछे जाने वाले प्रश्नों के संक्षिप्त उत्तर।

Type the six hex digits, without the hash, into the HEX Color field. The RGB card updates immediately and Copy rgb() function copies the result in CSS form.

Yes. Type the three digits and leave the field; the code is expanded to six digits, for example FF8800, and the other values update.

The HEX field holds six characters. If you paste a code with a leading #, the last digit is cut off. Paste only the six digits.

It takes the higher of the colour's contrast ratios against white and against black, then labels it AAA at 7 or more, AA at 4.5 or more, AA Large at 3 or more, or Fail below 3.

No. The tool works with opaque colours only and does not handle alpha values or eight-digit hex codes.

HSL values are rounded to whole numbers, so converting through HSL can change an RGB channel by one. Copy the HEX or RGB value when you need an exact match.

No. All conversions, contrast calculations and harmonies are computed by JavaScript in your browser.

टिप्पणियाँ (0)

उपयोगकर्ता चर्चा, असामान्य परिस्थितियाँ, और अनुवर्ती सुझावों के लिए।
टिप्पणी करें
आपकी टिप्पणी सबमिट करने के बाद सार्वजनिक रूप से दिखाई देगी।
अभी तक कोई टिप्पणी नहीं। टिप्पणी करने वाले पहले व्यक्ति बनें!
हमें बताएं!
इस उपकरण में समस्या की रिपोर्ट करें

आपको जो समस्या आई, उसका वर्णन करें ताकि हम इसकी जांच कर सकें और टूल में सुधार कर सकें।

सबसे ज्यादा मदद क्या करता है
इनपुट, अपेक्षित परिणाम, वास्तविक परिणाम, ब्राउज़र/डिवाइस, और जब सहायक हो तो एक स्क्रीनशॉट शामिल करें।
स्क्रीनशॉट बटन ब्राउज़र में पृष्ठ को कैप्चर करता है और उत्पन्न छवि को इस फॉर्म से संलग्न करता है।
पूरे पेज का स्क्रीनशॉट
आपके ब्राउज़र में newisty के साथ कैप्चर किया गया।
अभी तक कोई स्क्रीनशॉट नहीं लिया गया है।
उपकरण रिपोर्ट