The calculated colors don't return exactly what Sass returns. #5

Open
edwardball opened this Issue Aug 23, 2013 · 7 comments

Projects

None yet

5 participants

@edwardball

Hi,

Love this tool, but just wanted to point out that there is a little problem in calculating the colours. I'll give you a couple of examples.

Using the tool, lightening or darkening a color by 0 changes the color, when it should actually remain the same.

Eg: #123456.
Lighten by 0 gives #133659
Darken by 0 gives #123354

And sticking with #123456, darkening it by 10% with SASS gives #091a2c, but your tool returns #09192a.

Cheers

@DarrenN
Contributor
DarrenN commented Aug 23, 2013

Thanks for the heads up @Aptary - I suspect this is mostly due differences in how JS and Ruby treat numbers / math. Will update our tests and see if we can't get it sorted out.

@mattstudio

I'm having the same problem. It seemed like just the tool I was looking for, until I started using it and I kept getting values that were not the same between this tool and sass. :(

SassMe: lighten(#7EB9E8, 26) --> #f2f8fd
Sass: lighten(#7EB9E8, 26) --> #eff6fc

@Martskin
Martskin commented Jul 3, 2014

Yep, same problem here. :(
SassMe: desaturate(adjust_hue(lighten(#444346,22),3),1) -- > #7c7b7f
Sass : desaturate(adjust_hue(lighten(#444346,22),3),1) -- > #7c7b7e

@DarrenN
Contributor
DarrenN commented Jul 7, 2014

Pull requests welcome.

@jimniels
Contributor

The project now lives under my github jimniels/sassme (and is live at jim-nielsen.com/sassme. Any suggestions, issues, improvements, or PRs are welcome there :)

FWIW: this problem was fixed in v2 of the site I launched. The slight color differences were due to a tiny rounding error in javascript.

@DarrenN
Contributor
DarrenN commented Sep 27, 2016

What even are JavaScript numbers?

@jimniels
Contributor

Javascript numbers are strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment