Skip to content

Instantly share code, notes, and snippets.

@bhauman
Created September 17, 2010 19:49
Show Gist options
  • Select an option

  • Save bhauman/584817 to your computer and use it in GitHub Desktop.

Select an option

Save bhauman/584817 to your computer and use it in GitHub Desktop.
sass function to test if a color is a dark color
module Sass::Script::Functions
def dark_color(color)
assert_type color, :Color
Sass::Script::Bool.new( (color.rgb.sum / 3.0) < 128 )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment