Skip to main content

Utility Functions

normalize(_ value: Int, min: Int, max: Int) -> (Float)

Maps the integer value to the range [0, 1].

denormalize(_ value: Float, min: Int, max: Int) -> (Int)

Maps the normalized value to the closest integer value in the range [min, max].