export const clamp = (val, bottom, top) => { return Math.max(bottom, Math.min(top, val)); };