Skip to content

Instantly share code, notes, and snippets.

@timothy
Created February 4, 2017 20:11
Show Gist options
  • Save timothy/8bf6474c810b5d8f07d2d46fd092e52e to your computer and use it in GitHub Desktop.
Save timothy/8bf6474c810b5d8f07d2d46fd092e52e to your computer and use it in GitHub Desktop.
function Clamp(x, min, max) {
return x < min ? min: (x > max ? max: x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment