Is there an inverse `lerp` in Compose? Like when I...
# compose
d
Is there an inverse
lerp
in Compose? Like when I have
start=10.dp
,
end=20.dp
,
current=15.dp
and want to feed this to that function and receive
fraction=0.5
back.
k
(current-start)/(end-start) ?
🦜 1
d
yep, this one. it's just that
lerp
exists in Compose, which is also a one-liner, so I thought maybe inverse one exists too, only I didn't know how to find it.