module Sass::Extras::Contrast::Utils

Public Class Methods

abs(array, other) click to toggle source
# File lib/sass/extras/contrast.rb, line 114
def self.abs(array, other)
  array.zip(other).map { |x, y| (x.to_f - y.to_f).abs }
end
mul(array, other) click to toggle source
# File lib/sass/extras/contrast.rb, line 118
def self.mul(array, other)
  array.zip(other).map { |x, y| x.to_f * y.to_f }
end
sq(array) click to toggle source
# File lib/sass/extras/contrast.rb, line 126
def self.sq(array)
  array.map { |e| e**2 }
end
sum(array) click to toggle source
# File lib/sass/extras/contrast.rb, line 122
def self.sum(array)
  array.inject(0) { |sum, value| sum + value.to_f }
end