Skip to content

Commit 7b83c42

Browse files
committed
add color group library
1 parent 0dd1486 commit 7b83c42

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

library/color_group/color_group.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
java_import Java::Monkstone::ColorUtil
2+
3+
class ColorGroup
4+
attr_reader :web_colors, :pcolors
5+
def initialize(web)
6+
@web_colors = web
7+
@pcolors = ColorUtil.web_array(web)
8+
end
9+
10+
def shuffle
11+
@pcolors = ColorUtil.web_array(web_colors.shuffle)
12+
end
13+
14+
def shuffle!
15+
web_colors.shuffle!
16+
@pcolors = ColorUtil.web_array(web_colors)
17+
end
18+
end

0 commit comments

Comments
 (0)