Restrict swatch to bounds of SL picker

This commit is contained in:
Moez Bhatti
2018-03-24 01:57:33 -04:00
parent dcff7e8c6c
commit 65d57f2afd
3 changed files with 29 additions and 26 deletions
@@ -34,4 +34,8 @@ fun Int.forEach(action: (Int) -> Unit) {
for (index in 0 until this) {
action(index)
}
}
fun Float.within(min: Float, max: Float): Float {
return Math.min(max, Math.max(min, this))
}