From 26a53008ad8179685451beff39b99ccff380e03f Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Mon, 1 Mar 2021 20:45:54 -0500 Subject: [PATCH] Rephrase interpolation to be more generic wrt to interpolation space instead of phrasing every other space as an exception to Lab --- css-color-4/Overview.bs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/css-color-4/Overview.bs b/css-color-4/Overview.bs index 20e424269ad5..65a114ce38ec 100644 --- a/css-color-4/Overview.bs +++ b/css-color-4/Overview.bs @@ -4403,7 +4403,7 @@ Interpolation In general, interpolation between <> values occurs by linearly interpolating each component of the computed value of the color - separately, in Lab. + separately, in a given color space which will be referred to as the 'interpolation space' below. - - The exception is that if all the <>s to be interpolated - are sRGB values, and they are all expressed in a legacy syntax - such as hex colors, named colors, + Different color spaces may be more appropriate for each interpolation use case. + For example, Lab works well for gradients, and LCH works well for color mixing. + The host syntax may define what the default interpolation space should be for each case, + and optionally provide syntax for authors to override this default. + + If the host syntax does not define what colorspace interpolation should take place in, + it defaults to Lab. In that case, user agents may handle interpolation + between legacy sRGB color formats + (hex colors, named colors, ''rgb()'', ''hsl()'' or ''hwb()'' - (and the equivalent alpha-including forms) - then they are interpolated in gamma-encoded sRGB space. - + and the equivalent alpha-including forms) + in gamma-encoded sRGB space. This provides Web compatibility; legacy sRGB content interpolates in the sRGB space by default. This also means that authors can choose to opt-in to Lab interpolation by using the non-legacy ''color(srgb r g b)'' form. + Issue(5928): + +

Interpolating with alpha