Sampling sRGB pixels and naming the same color
A screen pixel in the default web model is an sRGB triple: three bytes for red, green, and blue. A picker reads that triple from a bitmap or from the display, then writes it as #RRGGBB, rgb(), hsl(), or hsv()—different coordinates for one color.
Paste-only conversion between rgb() and hex lives on the RGB to hex page. Drop the resulting declaration into a stylesheet with the CSS formatter.
Pixels, models, and what a sample means
What an sRGB pixel sample actually records
- Each channel is an 8-bit level from 0 to 255 in the sRGB encoding used by typical monitors and CSS.
- Sampling a bitmap reads the stored texel, not a named brand color.
- JPEG and resized images average neighboring pixels, so a click can land between two intended swatches.
- A screenshot of a wide-gamut display may already have been converted into sRGB before you sample it.
HEX and RGB as two writings of one byte triple
- #RRGGBB packs the same three bytes as rgb(r, g, b).
- Hex is base 16: two digits per channel, so 255 is FF.
- Letter case does not change the color.
- Neither notation includes alpha unless you add a fourth component.
How HSL and HSV split hue from intensity
- Hue is an angle around the color wheel, usually 0–360.
- HSL lightness is 0% black and 100% white; 50% is the fully saturated hue.
- HSV value is the brightest channel; saturation is how far the color sits from gray at that value.
- The same hue can be a dark HSL color and a bright HSV color—the formulas are not interchangeable.
Eyedropper samples versus file pixels
- An image click reads the decoded bitmap in sRGB.
- A screen eyedropper reads a composited display pixel, including overlays and color management.
- Those two numbers match only when the bitmap and the screen use the same encoding.
- System color dialogs also return an sRGB hex, which CSS can use directly as a color.
Where sampled colors are used
Matching a mockup
A pixel from a screenshot becomes the hex token a stylesheet stores.
Theme ramps
HSL makes it easier to hold hue and step lightness than editing raw hex.
Frequently asked questions
How do I get a hex code from a picture?
Open the image and click the pixel. The sample is the sRGB triple at that point, written as #RRGGBB and rgb().
Color picker vs RGB to hex?
This page samples a pixel or a swatch and shows HEX, RGB, HSL, and HSV. RGB to hex converts a color string you already have.
Why does the click not match the color I see?
JPEG, scaling, and display profiles change bytes before the sample. The value is the stored or composited pixel, not a brand name.
What is the difference between HSL and HSV?
HSL lightness runs from black to white. HSV value is the maximum channel. Same hue, different saturation and brightness formulas.
Does #RRGGBB include transparency?
No. Alpha needs rgba() or an eight-digit hex. This sample is the opaque sRGB triple.
Why is eyedropper missing?
The EyeDropper API exists only in some browsers. Image sampling and the system color control still return an sRGB value.
Can I paste hsl() or rgb()?
Yes. A parsed string is converted into the same byte triple, then shown in every notation.
Is a sampled hex the same in CSS?
For opaque sRGB colors, #RRGGBB and rgb() name that triple. Put it in a rule and format the sheet with the CSS formatter.