Created
June 18, 2010 18:04
-
-
Save emptyflask/443984 to your computer and use it in GitHub Desktop.
SASS mult() function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Author
emptyflask
commented
Jun 18, 2010
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment