Sha256: 78813e5f3b4e30820536902350501d878782d754bc7780848e2cee2aa015616e

Contents?: true

Size: 314 Bytes

Versions: 3

Compression:

Stored size: 314 Bytes

Contents

module Colors
  module Utils
    module_function def linspace(x0, x1, n)
      Array.new(n) { |i|
        x0 + i*(x1 - x0)/(n-1r)
      }
    end

    module_function def make_color(value)
      case value
      when Colors::AbstractColor
        value
      else
        Colors[value]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
red-colors-0.4.0 lib/colors/utils.rb
red-colors-0.3.0 lib/colors/utils.rb
red-colors-0.2.0 lib/colors/utils.rb