Sha256: fd47e84675f854ee404d0da06df8a51ca13f3470b54dba3631e7f27a5a243acc
Contents?: true
Size: 532 Bytes
Versions: 9
Compression:
Stored size: 532 Bytes
Contents
java_import Java::Monkstone::ColorUtil # class wraps a java color array, supports shuffle!, last and ruby_string # as well as ability to initialize with an array of "web" color string class ColorGroup attr_reader :colors def initialize(p5cols) @colors = p5cols end def self.from_web_array(web) ColorGroup.new(ColorUtil.web_array(web.to_java(:string))) end def shuffle! @colors = ColorUtil.shuffle(colors) end def ruby_string ColorUtil.rubyString(colors) end def last colors[0] end end
Version data entries
9 entries across 9 versions & 2 rubygems