Skip to content

Instantly share code, notes, and snippets.

@iamchiwon
Created August 29, 2018 05:05
Show Gist options
  • Select an option

  • Save iamchiwon/dbfd9de8ecafd6e9c486ccdafce35cdf to your computer and use it in GitHub Desktop.

Select an option

Save iamchiwon/dbfd9de8ecafd6e9c486ccdafce35cdf to your computer and use it in GitHub Desktop.
비례에 따른 값의 범위 변환
func ratioMap(_ _min: CGFloat, _ _max: CGFloat) -> (CGFloat, CGFloat) -> (CGFloat) -> CGFloat {
return { start, end in
{ value in
start + (value - _min) * (end - start) / (_max - _min)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment