Skip to content

Commit bd27abc

Browse files
committed
wovns hype
1 parent 5d4089d commit bd27abc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# encoding: utf-8
2+
load_library :hype
3+
include_package 'hype'
4+
# Access through Hype namespace
5+
module Hype
6+
java_import 'hype.extended.colorist.HColorPool'
7+
java_import 'hype.extended.layout.HGridLayout'
8+
end
9+
10+
PALETTE = %w(#B83D4E #B56A8C #4688B5 #A53643 #5869A0 #487A9C #95577E #302D32 #0C0000 #020100 #070707)
11+
12+
def settings
13+
size(2400, 6372)
14+
end
15+
16+
def setup
17+
sketch_title 'Color Pool'
18+
H.init(self)
19+
H.background(color('#242424'))
20+
colors = Hype::HColorPool.new(web_to_color_array(PALETTE))
21+
pool = HDrawablePool.new(15_876)
22+
pool.auto_add_to_stage
23+
.add(HRect.new(50))
24+
.layout(Hype::HGridLayout.new.start_x(0).start_y(0).spacing(50, 50).cols(126))
25+
.on_create do |obj|
26+
i = pool.current_index
27+
obj.no_stroke.fill(colors.get_color(i))
28+
end
29+
.request_all
30+
H.draw_stage
31+
save_frame(data_path('wovns.png'))
32+
end

0 commit comments

Comments
 (0)