Module: Sass::Script::Functions
- Defined in:
- lib/harsh.rb
Instance Method Summary collapse
-
#random(type = Sass::Script::String.new("number"), max = Sass::Script::Number.new(100)) ⇒ Object
gist.github.com/1561650 Chris E.
Instance Method Details
#random(type = Sass::Script::String.new("number"), max = Sass::Script::Number.new(100)) ⇒ Object
gist.github.com/1561650 Chris E.
6 7 8 9 10 11 12 |
# File 'lib/harsh.rb', line 6 def random(type = Sass::Script::String.new("number"), max = Sass::Script::Number.new(100)) ## https://gist.github.com/1561650 Chris E. if type.value == "color" Sass::Script::Color.new(:red => rand(255), :green => rand(255), :blue => rand(255)) else Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units) end end |