Sha256: f5ee91e10e19aa94405e5f4b36274a7ae5edb1489e9cb735604281b13b2e95c7
Contents?: true
Size: 540 Bytes
Versions: 84
Compression:
Stored size: 540 Bytes
Contents
require "sass" module Sass::Script::Functions # returns an IE hex string for a color with an alpha channel # suitable for passing to IE filters. # see http://msdn.microsoft.com/en-us/library/ms532930%28v=vs.85%29.aspx def ie_hex_str(color) assert_type color, :Color alpha = (color.alpha * 255).round alpha = alpha.to_s(16).rjust(2, '0') color_string = color.rgb.map {|num| num.to_s(16).rjust(2, '0')} .join Sass::Script::String.new("##{alpha}#{color_string}") end declare :ie_hex_str, :args => [:color] end
Version data entries
84 entries across 84 versions & 3 rubygems