Sorry for the little detail. The deal is: I created a mixin to handle background-colors with alpha, but IE8 and below (as usual) don't understand rgba. So I end up with this code:
@mixin background-color($color, $path, $alpha: 1) { $rgba: 'rgba(#' + $color + ', ' + $alpha + ')'; $css-color: unquote($rgba); $filename: 'solid-' + $color + '-' + $alpha * 100 + '.png'; $url: 'url(' + $path + $filename + ')'; background-color: unquote($url); background-color: $css-color; } Then I called the mixin this way: @include background-color(000000, .5); And I expect to get the following output: background-color: url('images/solid-000000-50.png'); background-color: rgba(0,0,0,.5); But I keep getting rgba like this: rgba(#000000, .5) I thought SASS would convert automatically hex color to rgb inside a rgba(); On Wed, Jun 15, 2011 at 1:45 PM, Chris Eppstein <ch...@eppsteins.net> wrote: > I'd be interested to know why the output format matters. It seems like an > implementation detail to me. Please continue this conversation on the sass > mailing list. > > Hunt & pecked on my iPhone... Sorry if it's brief! > > On Jun 15, 2011, at 7:46 AM, Алёна <pionee...@gmail.com> wrote: > > Not sure if there is a built-in function, but you can get components of a > color this way: > red($color); > green($color); > blue($color); > > Here is the reference: > <http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#red-instance_method> > http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#red-instance_method > > 2011/6/16 Renan Couto < <renanco...@gmail.com>renanco...@gmail.com> > >> Is there a way to convert hex colors to RGB? >> > -- > You received this message because you are subscribed to the Google Groups > "Haml" group. > To post to this group, send email to haml@googlegroups.com. > To unsubscribe from this group, send email to > haml+unsubscr...@googlegroups.com. > 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 haml@googlegroups.com. > To unsubscribe from this group, send email to > haml+unsubscr...@googlegroups.com. > 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 haml@googlegroups.com. To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/haml?hl=en.