7 ms·
Is this really how SASS deals with colour? I tried inputting #DEADBE (a slightly violet shade of pink). Here are the results: 1. darken 10: #c09f62 (light brow
by Carioca 14y ago
Is this really how SASS deals with colour? I tried inputting #DEADBE (a slightly violet shade of pink). Here are the results:
1. darken 10: #c09f62 (light brown)
2. saturate 57 (max): #ffd68a, a light, slightly golden yellow
3. adjust_hue 302: #deabbb, virtually the same color.
- Carioca 14y agoFound a site[1] that compiles SASS online. Correct results: 1. darken(#deadbe, 20) => #c16484 2. saturate(#deadbe, 57) => #ff8cb4 3. adjust_hue(#deadbe, 302) => #cfadde All of these are much more reasonable results for these functions. [1]: http://sass-lang.com/try.html http://sass-lang.com/try.html
- hieronymusN 14y agoDarken/Lighten adjust the L (lightness) value in the HSL representation of the color. Saturate/Desaturation does the same for the S (saturation) value in the HSL representation of the color. Adjust_Hue moves the hue of the color (H in HSL) around a 360 degree color wheel. (from 0 - 360) https://en.wikipedia.org/wiki/HSL_and_HSV https://en.wikipedia.org/wiki/HSL_and_HSV If you look at how SASS handles colors under the hood, then yeah, that's how it does it.
- Carioca 14y agoThe site is actually behaving differently from SASS, see my self-reply: http://news.ycombinator.com/item?id=4539760 http://news.ycombinator.com/item?id=4539760 (I was writing it when you replied.
- hieronymusN 14y agoYou're right - we have a subtle math bug (JavaScript not known for its math precision..) SASS takes colors out to three decimal places, which we weren't. Will be pushing the fix to both GitHub and the live site shortly, along with some rendering fixes for IE8/9. Updated: fixed on GitHub - https://github.com/arc90/sass-color-picker/commit/4b2fc4fcad0fdcca89962c84c72de1ac0a8a8120 https://github.com/arc90/sass-color-picker/commit/4b2fc4fcad...