How to scale a object with distance from the center of the canvas?

i need to achieve a treadmill effect for the scroll view, i.e while scrolling the center object need to reduce in scale when moving away from center and vice versa? can someone point me in the right direction, im already calculating the center of the scrollview from the elements to achieve the snapping effect.

https://forum.unity3d.com/threads/find-anchoredposition-of-a-recttransform-relative-to-another-recttransform.330560/

get distance in pixels from another rect transform and divide it by your maxDistance. Use this coefficient to scale down your rectTransform