Skip to content

Instantly share code, notes, and snippets.

View emptyflask's full-sized avatar

Jon Roberts emptyflask

View GitHub Profile
@emptyflask
emptyflask / sass_multiply.rb
Created June 18, 2010 18:04
SASS mult() function
module Sass::Script::Functions
def mult(color1, color2)
c1 = color1.rgb.map { |c| c / 255.0 }
c2 = color2.rgb.map { |c| c / 255.0 }
Sass::Script::Color.new(c1.zip(c2).map { |a,b| (a*b*255).to_i })
end
end