pub fn scale_ratio<T>(ratio: f64, (left, mid, right): (T, T, T)) -> T where
    T: PartialOrd + FromPrimitive + ToPrimitive