{"id":22014052,"url":"https://github.com/dagronf/easie","last_synced_at":"2025-05-06T22:21:03.462Z","repository":{"id":262193999,"uuid":"886492236","full_name":"dagronf/Easie","owner":"dagronf","description":"A collection of cross-platform easing functions written in Swift","archived":false,"fork":false,"pushed_at":"2024-11-18T05:03:31.000Z","size":1377,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T10:43:53.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/dagronf.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":"2024-11-11T04:22:51.000Z","updated_at":"2024-12-05T08:16:09.000Z","dependencies_parsed_at":"2024-11-30T03:26:12.813Z","dependency_job_id":"a3a736df-93d3-4bca-aaf6-3a233d4576cd","html_url":"https://github.com/dagronf/Easie","commit_stats":null,"previous_names":["dagronf/easie"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FEasie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FEasie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FEasie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FEasie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dagronf","download_url":"https://codeload.github.com/dagronf/Easie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252777188,"owners_count":21802557,"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":[],"created_at":"2024-11-30T03:26:01.726Z","updated_at":"2025-05-06T22:21:03.439Z","avatar_url":"https://github.com/dagronf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Easing Functions (Easie)\n\n![tag](https://img.shields.io/github/v/tag/dagronf/Easie)\n![Platform](https://img.shields.io/badge/Platforms-macOS%20|%20iOS%20|%20tvOS%20|%20watchOS%20|%20visionOS%20|%20macCatalyst%20|%20Linux-lightgrey.svg)\n![License](https://img.shields.io/badge/License-MIT-apple)\n![Build](https://img.shields.io/github/actions/workflow/status/dagronf/Easie/swift.yml)\n\nA collection of cross-platform easing functions written in Swift with no dependencies on SwiftUI or CoreGraphics.\n\n## Simple example\n\n```swift\n// An ease-out curve\nlet unitCurve = EaseOutInEaseOut()\nlet unitY = unitCurve.value(at: 0.88)\n```\n\n## Easing Types\n\n| Type      |  `EaseIn`  |  `EaseOut`  |  `EaseInEaseOut`  | \n|-----------|------------|-------------|-------------------|\n| `sine`    | \u003cimg src=\"Art/images/path-easeIn(sine).png\" /\u003e | \u003cimg src=\"Art/images/path-easeOut(sine).png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOut(sine).png\" /\u003e | \n| `cubic`   | \u003cimg src=\"Art/images/path-easeIn(cubic).png\" /\u003e | \u003cimg src=\"Art/images/path-easeOut(cubic).png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOut(cubic).png\" /\u003e |\t\n| `quint`   | \u003cimg src=\"Art/images/path-easeIn(quint).png\" /\u003e | \u003cimg src=\"Art/images/path-easeOut(quint).png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOut(quint).png\" /\u003e |\n| `circ`    | \u003cimg src=\"Art/images/path-easeIn(circ).png\" /\u003e | \u003cimg src=\"Art/images/path-easeOut(circ).png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOut(circ).png\" /\u003e |\n| `quad`    | \u003cimg src=\"Art/images/path-easeIn(quad).png\" /\u003e | \u003cimg src=\"Art/images/path-easeOut(quad).png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOut(quad).png\" /\u003e |\n| `quart`   | \u003cimg src=\"Art/images/path-easeIn(quart).png\" /\u003e | \u003cimg src=\"Art/images/path-easeOut(quart).png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOut(quart).png\" /\u003e |\n| `expo`    | \u003cimg src=\"Art/images/path-easeIn(expo).png\" /\u003e | \u003cimg src=\"Art/images/path-easeOut(expo).png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOut(expo).png\" /\u003e |\t\n| `bounce`  | \u003cimg src=\"Art/images/path-easeInBounce.png\" /\u003e | \u003cimg src=\"Art/images/path-easeOutBounce.png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOutBounce.png\" /\u003e |\n| `back`    | \u003cimg src=\"Art/images/path-easeInBack.png\" /\u003e | \u003cimg src=\"Art/images/path-easeOutBack.png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOutBack.png\" /\u003e |\n| `elastic` | \u003cimg src=\"Art/images/path-easeInElastic.png\" /\u003e | \u003cimg src=\"Art/images/path-easeOutElastic.png\" /\u003e | \u003cimg src=\"Art/images/path-easeInEaseOutElastic.png\" /\u003e |\n\n### Examples\n\n```swift\n// An ease-out curve\nlet unitCurve = EaseOut(.cubic)\nlet unitY = unitCurve.value(at: 0.25)\n```\n\n```swift\n// An ease-in-ease-out elastic curve\nlet unitY = easeInEaseOutElastic(at: 0.68)\n```\n\n## Cubic Types\n\nA Cubic bezier curve with the first point `P0` as (0.0, 0.0) and last point `P3` as (1.0, 1.0). \n\nA cubic Bézier curve is defined by four points: P0, P1, P2, and P3. The points P0 and P3 represent the start and the end of the curve\n\n\u003cimg src=\"Art/images/cubic-bezier-overview.png\" /\u003e\n\nCubic Bézier curves with the P1 or P2 coordinate outside the [0, 1] range can cause the value to go farther than the\nfinal state and then return.\n\n\u003cimg src=\"Art/images/path-CubicBezier(0.1,0.6,0.7,0.2).png\" /\u003e\n\u003cimg src=\"Art/images/path-CubicBezier(0.3,0.2,0.2,1.4).png\" /\u003e\n\n```swift\nlet unitCurve = CubicBezierCurve(x1: 0.1, y1: 0.6, x2: 0.7, y2: 0.2)\nlet unitY = unitCurve.value(at: 0.25)\n```\n\n## Linear Types\n\nLinear curves define the `Y` values equally spaced along the t axis.\n\nA linear curve must always start at 0.0 and end at 1.0.\n\n\u003cimg src=\"Art/images/path-linear(0.0,0.1,0.5,0.9,1.0).png\" /\u003e\n\u003cimg src=\"Art/images/path-linear(0.0,0.5,1.0).png\" /\u003e\n\u003cimg src=\"Art/images/path-linear(0.0,0.25,0.25,1.0).png\" /\u003e\n\u003cimg src=\"Art/images/path-linear(0.0,0.125,0.25,1.0).png\" /\u003e\n\u003cimg src=\"Art/images/path-linear(0.0,1.0,0.0,1.0).png\" /\u003e\n\n### Examples\n\n```swift\nlet linear = Linear(values: [0.0, 0.25, 0.25, 1.0])\nlet unitY = linear.value(at: 0.25)\n```\n\n```swift\n// An linear curve\nlet linear = Linear(values: [0.0, 0.1, 0.5, 0.9, 1.0])\nlet unitY = linear.value(at: 0.68)\n```\n\n## Jump (step) Types\n\nJump curves define step function(s) that divides the domain of output values in equidistant steps\n\n| Type        | Image                                               | Description |\n|-------------|-----------------------------------------------------|-------------|\n| `jumpStart` | \u003cimg src=\"Art/images/path-jump-jumpStart-2.png\" /\u003e  | Jump up to the first step at the t=0.0 point, with the final step at t=1.0 | \n| `jumpEnd`   | \u003cimg src=\"Art/images/path-jump-jumpEnd-4.png\" /\u003e    | Jump up to the first step at the end of the first step |\n| `jumpNone`  | \u003cimg src=\"Art/images/path-jump-jumpNone-5.png\" /\u003e   | Jump up to the first step at the end of the first step, with the final step at 1.0 | \n| `jumpBoth`  | \u003cimg src=\"Art/images/path-jump-jumpBoth-3.png\" /\u003e   | Jump up to the first step at t=0 with the final step at 1.0 |\n\n### Examples\n\n```swift\nlet jump = Jump(.jumpEnd, steps: 4)\nlet unitY = jump.value(at: 0.25)\n```\n\n```swift\nlet jump = Jump(.jumpBoth, steps: 3)\nlet unitY = jump.value(at: 0.68)\n```\n\n## References\n\n* [Robert Penner](http://robertpenner.com/easing/) [archived](https://web.archive.org/web/20241108204417/http://robertpenner.com/easing)\n* [Nic Mulvaney](https://nicmulvaney.com/easing) [archived](https://web.archive.org/web/20240926061450/https://nicmulvaney.com/easing)\n* [Steps easing functions @ Mozilla](https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function#steps_easing_function)\n* [Cubic Bézier easing functions @ Mozilla](https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function#cubic_bézier_easing_function)\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2024 Darren Ford\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## Robert Penner MIT license\n\n[Easing terms of use](http://robertpenner.com/easing_terms_of_use.html) ([archive.org](https://web.archive.org/web/20240915222613/http://www.robertpenner.com/easing_terms_of_use.html))\n\n```\nMIT License\n\nCopyright © 2001 Robert Penner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Feasie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdagronf%2Feasie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Feasie/lists"}