kmk_firmware/kmk/utils.py
2022-02-07 16:25:45 -08:00

3 lines
69 B
Python

def clamp(x, bottom=0, top=100):
return min(max(bottom, x), top)