The sRGB to Display P3 converter translates standard web colors into the wide-gamut Display P3 space used by modern Apple and other high-end screens. It produces a CSS color(display-p3 r g b) value that renders identically on calibrated P3 displays while sRGB screens fall back gracefully.
When to use this tool
Use it when designing for Apple devices, modern Android flagships, or any display that supports the Display P3 gamut — which covers roughly 25% more colors than sRGB. Common scenarios include:
- Setting vivid accent colors for iOS or macOS apps using SwiftUI’s
Color(displayP3:...)initializer. - Writing CSS that takes advantage of
color(display-p3 ...)in Safari, Chrome, and Firefox on P3-capable hardware. - Checking whether a Figma or Sketch hex color has a direct P3 equivalent before you hand off to developers.
How the conversion works
sRGB and Display P3 share the same transfer curve (gamma) but use different primary colors, so converting between them is a linear matrix transform performed in linear light:
- Linearize each sRGB channel by inverting the sRGB gamma curve (the piecewise function with the 0.04045 threshold).
- sRGB → XYZ: multiply the linear sRGB vector by the standard sRGB-to-XYZ D65 matrix.
- XYZ → linear P3: multiply by the XYZ-to-linear-Display-P3 matrix.
- Re-encode each linear P3 channel with the P3 transfer curve (same gamma as sRGB) to get the final 0–1 components.
The result is the precise Display P3 representation of your input color.
Worked example
Consider the vivid orange #FF5733:
- sRGB channel values: R = 255, G = 87, B = 51 → normalized to 1.0, 0.341, 0.2
- After linearization and matrix math, the Display P3 output is approximately
color(display-p3 0.937 0.324 0.183) - Both values describe the same perceived color; P3 simply encodes it in a wider coordinate space
Reading the output and common mistakes
- Components are in the 0–1 range that
color(display-p3 ...)expects, not 0–255. - Because every sRGB color fits inside the P3 gamut, no clipping occurs for valid sRGB input — you will never see a P3 value below 0 or above 1 from a well-formed sRGB input.
- Do not paste the numeric P3 components directly into an sRGB color field — the numbers look similar but are in a different coordinate space and will render the wrong hue on sRGB-only displays.
- Use
@media (color-gamut: p3)in CSS to conditionally serve P3 colors; sRGB screens receive the regular hex fallback and look correct.
All calculations run locally in your browser — nothing is uploaded.