mix() will actually modify the saturation. darken() does darken the color without affecting hue and saturaton; it just does it on an absolute scale. So darken($light-blue, 50%) will lower the lightness by 50%, not make it half as light.
To get precisely the effect you want, you could do darken($light-blue, lightness($light-blue)/2). However, I would hope that darken() on its own serve you well enough. As a side note, in Sass 3.2, we'll allow users to define their own functions, so you can make a scale-lightness() function that does something like lighten($color, $scale * lightness($color)). On Wed, Aug 25, 2010 at 3:04 PM, BladeBronson <[email protected]>wrote: > Ah ha... I figured that SASS was too well-written for something this > big to still be around. I honestly mean that. > > My first instinct to darken a color (and not affect hue or saturation) > was to use the darken($light-blue, 50%) function. It looks like I > should be using mix($light-blue, #000000) or mix($light-blue, #000000, > XX%) for finer control. > > Thanks for clearing this up, fellas. > > > On Aug 25, 2:15 pm, Nathan Weizenbaum <[email protected]> wrote: > > On Wed, Aug 25, 2010 at 2:07 PM, BladeBronson <[email protected] > >wrote: > > > > > > > > > > > > > Before I file this, I'm just trying to figure out how much of this I'm > > > misunderstanding. :) > > > > > Using Photoshop orhttp://www.opentopia.com/tools/colcal/, my light > > > blue color (#ADC1CC) has the following values: > > > Hue: 201 > > > Saturation: 15 > > > Lightness: 80 > > > > > Using SASS: > > > >> $c = #ADC1CC > > > #adc1cc > > > >> hue($c) > > > 201.29deg > > > >> saturation($c) > > > 23.308% > > > >> lightness($c) > > > 73.922% > > > > > Saturation and Lightness are substantially off. Is this a bug, or > > > expected? > > > > Note that on the link you gave, it lists hue, saturation, and > *brightness*. > > This is a different color space than hue, saturation, and *lightness*. > > Confusing, I know. Seehttp://en.wikipedia.org/wiki/HSL_and_HSVfor an > > overview of the difference. Since CSS3 uses HSL, so do we. > > -- > You received this message because you are subscribed to the Google Groups > "Haml" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected] <haml%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/haml?hl=en.
