oulu-rails 0.6.27 → 0.6.28

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bda11afcc5e6d8390db901b874bc95aecc9b0ab
4
- data.tar.gz: 96b236b95831632ca6a32b6d528e1427ece2dde7
3
+ metadata.gz: 924a34f5042840b8bf4037867ec62662ecd6c888
4
+ data.tar.gz: 98d4a0fb4113c5eaf839df4bdd5af5cc59486959
5
5
  SHA512:
6
- metadata.gz: 15052cb4d50195cf1fbbcda536f4a539deec09cb994fe2dd0a6d603cd8e62cd00a4e7d2d71a7ae2917649ca461bef18358f1fd04e41ec3ed93073eb142a28e3c
7
- data.tar.gz: 18b5e128bf43f6b15aa5846f7fc601c3b55487450062c739e8833c398df2165f8d32dfe9a07348c8ce7d498435652e29e339781d9a8f8d3c01f1e9fbcd5befe3
6
+ metadata.gz: b55ffe3120585f32fe79e2f42c7015f23a94a667d1cebf475036deaf24e13feba46a09cdb333db9ed6eb854b37f5f3d5e7ca2c9c70b44a3de42ab90c976d6b65
7
+ data.tar.gz: 2644fd2b7d31fd02f33f05b83aaf95d1ffb8b8f8126320c1cac9966b8faf16a374d33136c866634b9d88992c0718d435d5bfddd60a0e584515163edcf89c7cc3
@@ -1,3 +1,3 @@
1
1
  module OuluRails
2
- VERSION = "0.6.27"
2
+ VERSION = "0.6.28"
3
3
  end
@@ -14,6 +14,7 @@
14
14
 
15
15
  // functions
16
16
  ///////////////////
17
+ @import settings/functions/math
17
18
  @import settings/functions/list
18
19
  @import settings/functions/number
19
20
  @import settings/functions/string
@@ -23,10 +23,15 @@
23
23
  @return null
24
24
 
25
25
  @function luma($color)
26
- $r: red($color)
27
- $g: green($color)
28
- $b: blue($color)
29
- @return (0.299 * $r + 0.587 * $g + 0.114 * $b)/2.55
26
+ // Adapted from: https://gist.github.com/voxpelli/6304812
27
+ $rgba: red($color), green($color), blue($color)
28
+ $rgba2: ()
29
+ @for $i from 1 through 3
30
+ $rgb: nth($rgba, $i)
31
+ $rgb: $rgb / 255
32
+ $rgb: if($rgb < .03928, $rgb / 12.92, pow(($rgb + .055) / 1.055, 2.4))
33
+ $rgba2: append($rgba2, $rgb)
34
+ @return (.2126 * nth($rgba2, 1) + .7152 * nth($rgba2, 2) + .0722 * nth($rgba2, 3))*100
30
35
 
31
36
  $ruma-threshold: 100 / pi() !default
32
37
 
@@ -0,0 +1,31 @@
1
+ // https://gist.github.com/voxpelli/6304812
2
+
3
+ @function gcd($a, $b)
4
+ // From: http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript
5
+ @if ($b != 0)
6
+ @return gcd($b, $a % $b)
7
+ @else
8
+ @return abs($a)
9
+
10
+ @function pow($base, $exponent, $prec: 12)
11
+ // Handles decimal exponents by trying to convert them into a fraction and then use a nthRoot-algorithm for parts of the calculation
12
+ @if (floor($exponent) != $exponent)
13
+ $prec2 : pow(10, $prec)
14
+ $exponent: round($exponent * $prec2)
15
+ $denominator: gcd($exponent, $prec2)
16
+ @return nthRoot(pow($base, $exponent / $denominator), $prec2 / $denominator, $prec)
17
+ $value: $base
18
+ @if $exponent > 1
19
+ @for $i from 2 through $exponent
20
+ $value: $value * $base
21
+ @else if $exponent < 1
22
+ @for $i from 0 through -$exponent
23
+ $value: $value / $base
24
+ @return $value
25
+
26
+ @function nthRoot($num, $n: 2, $prec: 12)
27
+ // From: http://rosettacode.org/wiki/Nth_root#JavaScript
28
+ $x: 1
29
+ @for $i from 0 through $prec
30
+ $x: 1 / $n * (($n - 1) * $x + ($num / pow($x, $n - 1)))
31
+ @return $x
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oulu-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.27
4
+ version: 0.6.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - machida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-08 00:00:00.000000000 Z
11
+ date: 2015-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass-rails
@@ -140,6 +140,7 @@ files:
140
140
  - vendor/assets/stylesheets/settings/functions/_length.sass
141
141
  - vendor/assets/stylesheets/settings/functions/_list.sass
142
142
  - vendor/assets/stylesheets/settings/functions/_map.sass
143
+ - vendor/assets/stylesheets/settings/functions/_math.sass
143
144
  - vendor/assets/stylesheets/settings/functions/_number.sass
144
145
  - vendor/assets/stylesheets/settings/functions/_position.sass
145
146
  - vendor/assets/stylesheets/settings/functions/_reverse.sass