Sha256: 9e7f774fc31fc97601e4b7d73b9e69e5f537930a4c36368ca2ea281a24260327
Contents?: true
Size: 563 Bytes
Versions: 18
Compression:
Stored size: 563 Bytes
Contents
# frozen_string_literal: true 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
18 entries across 18 versions & 2 rubygems