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

Color.Manipulate.fadeOut on 'white' results in NaN #12

Open
semarco opened this issue Nov 16, 2016 · 3 comments
Open

Color.Manipulate.fadeOut on 'white' results in NaN #12

semarco opened this issue Nov 16, 2016 · 3 comments

Comments

@semarco
Copy link

semarco commented Nov 16, 2016

No description provided.

@eskimoblood
Copy link
Owner

Not sure how to reproduce this. I added this to my test suite and it pass:

  \() -> (Expect.equal (fadeOut 10 (hsla 1 1 1 1)) (hsla 1 1 1 0))

@dstreet26
Copy link

Red and Black work fine but White does not:

> Color.Manipulate.darken 0.25 Color.red
HSLA 0 1 0.15000000000000002 1 : Color.Color
> Color.Manipulate.darken 0.25 Color.black
HSLA NaN 0 0 1 : Color.Color
> Color.Manipulate.darken 0.25 Color.white
HSLA NaN NaN 0.75 1 : Color.Color

@eskimoblood
Copy link
Owner

Ok, seems like Elm cant convert white into HSL correctly:

toHsl Color.white
{ hue = NaN, saturation = NaN, lightness = 1, alpha = 1 }

Have a look here: https://github.com/elm-lang/core/issues/895

Unfortunately I have no time the next days working on it, maybe next week. You can add a pull request if you need it faster. It just needs a save version of toHsl that converts all NaNs to 0

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