Template repo for tiny cross-platform apps that can be modified on phone, tablet or computer.
slider_value = function(slider, x)
	local s = slider
	if x < s.x0 then x = s.x0 end
	if x > s.x1 then x = s.x1 end
	s.x = x
	s.value = s.lo + (s.x-s.x0)*(s.hi-s.lo)/(s.x1-s.x0)
	return s.value
end