Email or username:

Password:

Forgot your password?
Andy Bell

๐Ÿ“ New on Piccalilli: Applying P3 colours on an existing project

The set.studio site is powered by design tokens, which for colours, are hex codes. I managed to automatically convert those to P3 colours with a custom PostCSS plugin.

piccalil.li/blog/applying-p3-c

2 comments
Eric Portis

@belldotbz FYI that hexp3 site achieves a โ€œboostingโ€ effect basically by doing bad math. A faithful conversion would leave the colors the same (but give you more headroom to boost them yourself, if you so desired). Anyways in the end if it looks good (and it does) itโ€™s workinโ€™ I suppose.

Chris Lilley ๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ

@eeeps @belldotbz A faithful conversion from sRGB to display-p3 gives values which look exactly the same, yes. To make them more vibrant - convert sRGB to Oklch, increase the chroma, then decrease it (thus keeping hue and lightness constant) until it is *just* inside the p3 gamut. That last stage is gamut mapping, and Chrome refuses to do it.

Go Up