UNPKG

image-js

Version:

Image processing and manipulation in JavaScript

4 lines (3 loc) 107 B
export function clamp(value, image) { return Math.round(Math.min(Math.max(value, 0), image.maxValue)); }