Module: Bootstrap::Sass::Extensions::Functions

Included in:
Sass::Script::Functions
Defined in:
lib/bootstrap/sass/extensions/functions.rb

Instance Method Summary collapse

Instance Method Details

#ie_hex_str(color) ⇒ Object

Snatched from compass 0.11 - used for gradients in IE6-9 returns an IE hex string for a color with an alpha channel suitable for passing to IE filters.



5
6
7
8
9
10
# File 'lib/bootstrap/sass/extensions/functions.rb', line 5

def ie_hex_str(color)
  assert_type color, :Color
  alpha = (color.alpha * 255).round
  alphastr = alpha.to_s(16).rjust(2, '0')
  Sass::Script::String.new("##{alphastr}#{color.send(:hex_str)[1..-1]}".upcase)
end