Skip to content

edonv/Clamping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clamping

A simple library for conveniently clamping values to ranges.

Examples

let clamped1 = 25.clamped(to: 0...12) // = 12
let clamped2 = 10.clamped(to: 0...12) // = 10
let clamped3 = -10.clamped(to: 0...12) // = 0

let clamped4 = 25.clamped(to: 50...) // = 50
let clamped5 = 60.clamped(to: 50...) // = 60

let clamped6 = 25.clamped(to: ...50) // = 25
let clamped7 = 60.clamped(to: ...50) // = 50

About

A simple library for conveniently clamping values to ranges.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages