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

Make Gradient.Lerp and Gradient.ToColorArray More Precise #99

Open
Chris3606 opened this issue Jan 15, 2023 · 0 comments
Open

Make Gradient.Lerp and Gradient.ToColorArray More Precise #99

Chris3606 opened this issue Jan 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Chris3606
Copy link
Contributor

The current implementation appears to be more or less correct, but is rather awkwardly imprecise when it comes to lerp'ed values. See this unit test and the associated one for lerp (called LerpBasic); in even this simple test cases, lerp'ed values are off by 5 (eg 5/55 = ~2%) from what they should be.

It is likely some imprecision is unavoidable, particularly with floats; but it seems at least reasonable to expect more precision than this.

@Chris3606 Chris3606 added the enhancement New feature or request label Jan 15, 2023
@Chris3606 Chris3606 changed the title Make Gradient.Lerp and Gradient.ToColorArray More Imprecise Make Gradient.Lerp and Gradient.ToColorArray More Precise Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant