bracket lower_threshold upper_threshold x
| x < lower_threshold = 0
| x > upper_threshold = 255
- | otherwise = truncate (r * 255)
+ | otherwise = truncate (r * 255)
where
numerator = x - lower_threshold
denominator = upper_threshold - lower_threshold