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

HslColor.cs Simple Lerp Bug #809

Closed
TriggerJock opened this issue May 11, 2023 · 2 comments
Closed

HslColor.cs Simple Lerp Bug #809

TriggerJock opened this issue May 11, 2023 · 2 comments

Comments

@TriggerJock
Copy link

In HslColor.cs there is a bug preventing Lerp from interpolating the Lightness parameter. Looks like a simple typo:

    public static HslColor Lerp(HslColor c1, HslColor c2, float t)
    {
        // loop around if c2.H < c1.H
        var h2 = c2.H >= c1.H ? c2.H : c2.H + 360;
        return new HslColor(
            c1.H + t*(h2 - c1.H),
            c1.S + t*(c2.S - c1.S),
            c1.L + t*(c2.L - c2.L));
    }

The line:

            c1.L + t*(c2.L - c2.L));

Should be:

            c1.L + t*(c2.L - c1.L));

I've never done a pull request before, I'll look into it and see if I can start the process for this change.

@toore
Copy link
Contributor

toore commented Apr 16, 2024

This is merged, shouldn't we close this ticket?

@AristurtleDev
Copy link
Collaborator

This is merged, shouldn't we close this ticket?

Yep, if issue was resolved in merge, ticket should have been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants