sassy-math 1.3 → 1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/sassy-math.rb +7 -3
- data/sassy-math.gemspec +1 -1
- metadata +3 -3
data/lib/sassy-math.rb
CHANGED
@@ -48,8 +48,12 @@ module Sass::Script::Functions
|
|
48
48
|
end
|
49
49
|
Sass::Script::Number.new(result)
|
50
50
|
end
|
51
|
-
def random(max = Sass::Script::Number.new(100)) ##
|
52
|
-
|
51
|
+
def random(type = Sass::Script::String.new("number"), max = Sass::Script::Number.new(100)) ## https://gist.github.com/1561650 and modified by https://github.com/bookcasey
|
52
|
+
if type.value == "color"
|
53
|
+
Sass::Script::Color.new(:red => rand(255), :green => rand(255), :blue => rand(255))
|
54
|
+
else
|
55
|
+
Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
|
56
|
+
end
|
53
57
|
end
|
54
58
|
def hypot(a, b)
|
55
59
|
a = a.value.to_f
|
@@ -153,7 +157,7 @@ end
|
|
153
157
|
|
154
158
|
module SassyMath
|
155
159
|
|
156
|
-
VERSION = "1.
|
160
|
+
VERSION = "1.4"
|
157
161
|
DATE = "2012-07-29"
|
158
162
|
|
159
163
|
end
|
data/sassy-math.gemspec
CHANGED
metadata
CHANGED