Guest User

Untitled

a guest
Jan 11th, 2011
66
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'compass'
  2. require 'sass'
  3.  
  4. module Sass::Script::Functions
  5.   def ie_rgba(color)
  6.     assert_type color, :Color
  7.  
  8.     red, green, blue = color.rgb.map { |num| num.to_s(16).rjust(2, '0') }
  9.     alpha = (color.alpha * 255).round.to_s(16).rjust(2, '0')
  10.     Sass::Script::String.new("##{alpha}#{red}#{green}#{blue}")
  11.   end
  12. end
RAW Paste Data