This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension FloatingPoint { | |
typealias ModulationRange = (lowerBound: Self, upperBound: Self) | |
/// Translates the given floating point between two ranges. | |
/// Limit defaults to true. If limit is set to false, the value returned can be outside of the "to" range. | |
/// | |
/// Using the Modulate function | |
/// ---------------------------------------------------------- | |
/// Say you'd like to transform a view's scale from `1.0` to `0.45` depending on some other factor, like scroll amount. | |
/// The `from` could be `0...120` and the `to` would be`1.0...0.45`, which would mean at `0` content offset, the transform would be `1.0` |
OlderNewer