Sha256: 0705415117564d09efe66c425c7efefb51b7904bf5176a78a10c859504692964

Contents?: true

Size: 414 Bytes

Versions: 3

Compression:

Stored size: 414 Bytes

Contents

require 'ws_light/set/color_set'

module WSLight
  module Set
    # Creates a set with all random colors
    class RandomSet < ColorSet
      def frame
        @set ||= generate_set
      end

      def pixel(number, _frame = 0)
        frame[number]
      end

      def generate_set
        set = []
        @full_length.times do
          set << Color.random
        end
        set
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ws_light-0.4.2 lib/ws_light/set/random_set.rb
ws_light-0.3.0 lib/ws_light/set/random_set.rb
ws_light-0.2.0 lib/ws_light/set/random_set.rb