Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add lerp function #86

Merged
merged 2 commits into from
Jul 8, 2024
Merged

feat: add lerp function #86

merged 2 commits into from
Jul 8, 2024

Conversation

aleclarson
Copy link
Member

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Introduce the lerp function for linear interpolation, a common need in frontend JavaScript. This function will be used in the upcoming color-mixing PR.

Questions

  1. Does this fit in Radashi?
    I believe it does. In my years as a frontend dev, I've written my own lerp countless times. It's small enough to not be a big deal for Node.js applications using Radashi.
  2. Should it have a better name?
    I settled on lerp since it's the most commonly used name for such a function. I included an "Etymology" section in the docs to hopefully clear up any confusion.

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

Copy link
Contributor

@adamhamlin adamhamlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the etymology section 👍

@aleclarson aleclarson merged commit 072778f into main Jul 8, 2024
4 checks passed
@aleclarson aleclarson deleted the feat/lerp-fn branch July 8, 2024 02:31
Copy link

github-actions bot commented Jul 8, 2024

A new beta version 12.2.0-beta.ef0154b has been published to NPM. 🚀

To install:

The radashi@beta tag also includes this PR.

See the changes

@aleclarson aleclarson added the new feature This PR adds a new function or extends an existing one label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This PR adds a new function or extends an existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants