color_quant/
math.rs

1#[inline]
2pub(crate) fn clamp(a: i32) -> i32 {
3    if a < 0 {
4        0
5    } else if a > 255 {
6        255
7    } else {
8        a
9    }
10}