{"id":18269816,"url":"https://github.com/LeoNatan/LNInterpolation","last_synced_at":"2025-04-04T23:31:32.502Z","repository":{"id":63916395,"uuid":"70064965","full_name":"LeoNatan/LNInterpolation","owner":"LeoNatan","description":"An interpolation framework for Cocoa and Cocoa Touch.","archived":true,"fork":false,"pushed_at":"2023-02-16T11:32:19.000Z","size":323,"stargazers_count":30,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T02:17:07.192Z","etag":null,"topics":["cocoa","cocoa-touch","interpolation","objective-c","swift"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeoNatan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-05T13:50:41.000Z","updated_at":"2023-10-26T13:46:53.000Z","dependencies_parsed_at":"2024-11-05T11:41:55.983Z","dependency_job_id":"d3e99f46-0925-4f3d-9548-aab4ea78c178","html_url":"https://github.com/LeoNatan/LNInterpolation","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.3571428571428571,"last_synced_commit":"0c536276c537da00ec14c8f6f86ed607a030eba6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoNatan%2FLNInterpolation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoNatan%2FLNInterpolation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoNatan%2FLNInterpolation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoNatan%2FLNInterpolation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeoNatan","download_url":"https://codeload.github.com/LeoNatan/LNInterpolation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266476,"owners_count":20910831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoa","cocoa-touch","interpolation","objective-c","swift"],"created_at":"2024-11-05T11:37:20.477Z","updated_at":"2025-04-04T23:31:31.181Z","avatar_url":"https://github.com/LeoNatan.png","language":"Objective-C","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=BR68NJEJXGWL6"],"categories":["swift"],"sub_categories":[],"readme":"# LNInterpolation\n\nAn interpolation framework for Cocoa and Cocoa Touch.\n\n[![GitHub release](https://img.shields.io/github/release/LeoNatan/LNInterpolation.svg)](https://github.com/LeoNatan/LNInterpolation/releases) [![GitHub stars](https://img.shields.io/github/stars/LeoNatan/LNInterpolation.svg)](https://github.com/LeoNatan/LNInterpolation/stargazers) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/LeoNatan/LNInterpolation/master/LICENSE) \u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=BR68NJEJXGWL6\" title=\"Donate to this project using PayPal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg?style=flat\" alt=\"PayPal Donation Button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n[![GitHub issues](https://img.shields.io/github/issues-raw/LeoNatan/LNInterpolation.svg)](https://github.com/LeoNatan/LNInterpolation/issues) [![GitHub contributors](https://img.shields.io/github/contributors/LeoNatan/LNInterpolation.svg)](https://github.com/LeoNatan/LNInterpolation/graphs/contributors) [![Swift Package Manager compatible](https://img.shields.io/badge/swift%20package%20manager-compatible-green)](https://swift.org/package-manager/) [![Carthage compatible](https://img.shields.io/badge/carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n## Protocol\n\nThe framework defines a protocol, `LNInterpolable` (`Interpolable` in Swift), defining a common API for interpolating between two values.\n\nThe protocol defines two methods.\n\n### Objective C\n\n```objective-c\n- (instancetype)interpolateToValue:(id)toValue progress:(double)progress;\n- (instancetype)interpolateToValue:(id)toValue progress:(double)progress behavior:(LNInterpolationBehavior)behavior;\n```\n\n### Swift\n\n```\npublic func interpolate(to toValue: Any, progress: Double) -\u003e Self\npublic func interpolate(to toValue: Any, progress: Double, behavior: InterpolationBehavior) -\u003e Self\n```\n\nThe first variant returns an interpolated value between the original and `toValue` according to progress, using the default behavior.\nThe second is similar, but receives a behavior modifier. Each implementation can use this to choose how to implement the interpolation between the values. A default value of `LNInterpolationBehaviorUseDefault` (`.useDefault` in Swift) is always available.\n\n## Provided Implementations\n\nThe framework provides implementation for the most common cases where interpolation may be needed.\n\n### `NSValue` and `NSNumber`\n\nAn implementation is provided for `NSValue`, which provides support for the following values:\n\n* Numbers (`NSNumber`)\n\t* Decimal numbers (`NSDecimalNumber`)\n* Core Graphics: `CGPoint`, `CGSize`, `CGVector`, `CGRect`, `CGAffineTransform` (`NSValue`)\n* UIKit: `UIOffset`, `UIEdgeInsets` (`NSValue`)\n* AppKit: `NSEdgeInsets` (`NSValue`)\n\n\u003cimg src=\"Supplements/Numbers.png\" /\u003e\n\u003cimg src=\"Supplements/Values.png\" /\u003e\n\n### `UIColor` and `NSColor`\n\nAn implementation is provided for colors (both for iOS and macOS). By default, color interpolation is performed in Lab colorspace for best possible interpolation quality. If performance is an issue, you may use `LNInterpolationBehaviorUseRGBColorSpace` (`.useRGBColorSpace` in Swift) to specify a behavior where RGB colorspace is used.\n\n\u003cimg src=\"Supplements/Colors.png\" /\u003e\n\n## Demo Playground\n\nA demo playground is provided. Open LNInterpolationExample/LNInterpolationExample.xcworkspace and build the framework for macOS. Open the playground and explore the available pages.\n\n## Adding to Your Project\n\n### Swift Package Manager\n\nSwift Package Manager is the recommended way to integrate `LNInterpolation` in your project.\n\n`LNInterpolation` supports SPM versions 5.1.0 and above. To use SPM, you should use Xcode 11 to open your project. Click `File` -\u003e `Swift Packages` -\u003e `Add Package Dependency`, enter `https://github.com/LeoNatan/LNInterpolation`. Select the version you’d like to use.\n\nYou can also manually add the package to your `Package.swift` file:\n\n```swift\n.package(url: \"https://github.com/LeoNatan/LNInterpolation.git\", from: \"1.0\")\n```\n\nAnd the dependency in your target:\n\n```swift\n.target(name: \"BestExampleApp\", dependencies: [\"LNInterpolation\"]),\n```\n\n### Carthage\n\nAdd the following to your Cartfile:\n\n```github \"LeoNatan/LNInterpolation\"```\n\n### Manual\n\nDrag the `LNInterpolation.xcodeproj` project to your project, and add `LNInterpolation.framework` to **Embedded Binaries** in your project target's **General** tab. Xcode should sort everything else on its own.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeoNatan%2FLNInterpolation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeoNatan%2FLNInterpolation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeoNatan%2FLNInterpolation/lists"}