From 2aa4f66e01e3ab01dcbb005588b2baca05d953a4 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 12 Nov 2010 08:47:00 -0800 Subject: [PATCH] The sass utilities can live in two places for a while. --- lib/compass/sass_extensions/functions/colors.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/compass/sass_extensions/functions/colors.rb b/lib/compass/sass_extensions/functions/colors.rb index 29e9d9ee..39643756 100644 --- a/lib/compass/sass_extensions/functions/colors.rb +++ b/lib/compass/sass_extensions/functions/colors.rb @@ -1,10 +1,15 @@ module Compass::SassExtensions::Functions::Colors + if defined?(Sass::Util) + include Sass::Util + else + include Haml::Util + end # a genericized version of lighten/darken so that negative values can be used. def adjust_lightness(color, amount) assert_type color, :Color assert_type amount, :Number - color.with(:lightness => Sass::Util.restrict(color.lightness + amount.value, 0..100)) + color.with(:lightness => restrict(color.lightness + amount.value, 0..100)) end # Scales a color's lightness by some percentage. @@ -20,7 +25,7 @@ module Compass::SassExtensions::Functions::Colors def adjust_saturation(color, amount) assert_type color, :Color assert_type amount, :Number - color.with(:saturation => Sass::Util.restrict(color.saturation + amount.value, 0..100)) + color.with(:saturation => restrict(color.saturation + amount.value, 0..100)) end # Scales a color's saturation by some percentage.