W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

Re: [csswg-drafts] [css-values-4] How to interpolate <ratio>? (#4953)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Thu, 05 Nov 2020 18:34:24 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-722561724-1604601263-sysbot+gh@w3.org>
@tabatkins I think the formula needs to special-case `positive/0`, `0/positive` and `0/0` at interpolation boundaries. For example, the interpolation between `0/1` and `1/1` at distance `1` should be `1/1` according to https://drafts.csswg.org/css-values/#interpolation, but the formula produces `10^(log(0)*0 + log(1)*1) = 10^(-∞*0 + 0*1) = NaN = 0/0`.

Also, it may be useful to note that the formula can be simplified to `ratio1^(1-p) * ratio2^p`, and in the halfway example this is the [geometric mean](https://en.wikipedia.org/wiki/Geometric_mean).

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4953#issuecomment-722561724 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 5 November 2020 18:34:26 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC