Sha256: 5265da432909cd653208c2b93eaf66bc6425ca480b0932c2f2cdaaec699892c0
Contents?: true
Size: 598 Bytes
Versions: 13
Compression:
Stored size: 598 Bytes
Contents
# frozen_string_literal: true java_import Java::Monkstone::ColorUtil # class wraps a java color array (of signed int), supports shuffle!, last and # ruby_code (string for use in ruby code). As well as ability to initialize # with an ruby 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)) end def shuffle! @colors = ColorUtil.shuffle(colors) end def ruby_string ColorUtil.rubyString(colors) end def last colors[0] end end
Version data entries
13 entries across 13 versions & 1 rubygems