Right. so a scaling-based function doesn't have that property but the differenced-based version that we use in sass does.
chris On Wed, Aug 25, 2010 at 5:17 PM, Noel <[email protected]> wrote: > do you mean that because of rounding doing it as I inferred would mean that > > darken(lighten($c, 25%), 25%) == $c > is false? > > I would expect it to be true so if I have a color I lighten it by 50% > and then darken it by 50% I am back to the original color. > > > > > On Wed, Aug 25, 2010 at 4:48 PM, Chris Eppstein <[email protected]> > wrote: > > Would you expect this to be true or false? > > darken(lighten($c, 25%), 25%) == $c > > -chris > > > > On Wed, Aug 25, 2010 at 4:46 PM, Noel <[email protected]> wrote: > >> > >> For what it's worth, as a outside observer just following along and > >> having never used the function. My initial expectation upon reading > >> darken($light-blue, 50%) was that it would be darkened by 50%. > >> > >> so in the example given > >> arken(#ADC1CC, 50%) =~ #2F414B, since 74% - 50% = 24% > >> > >> I was expecting 74%/2 not 74%-50% > >> > >> Wonder what others would expect. > >> > >> > >> On Wed, Aug 25, 2010 at 3:36 PM, Nathan Weizenbaum <[email protected]> > >> wrote: > >> > 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_HSVforan > >> >> > 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]<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] <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] <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] <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.
