Skip to content

Commit 0cfe0e9

Browse files
committed
revert propane to JRubyArt
1 parent b1e15fe commit 0cfe0e9

File tree

1 file changed

+38
-46
lines changed

1 file changed

+38
-46
lines changed
Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,43 @@
1-
#!/usr/bin/env jruby
2-
require 'propane'
1+
load_library :hype
2+
include_package 'hype'
3+
java_import 'hype.extended.layout.HGridLayout'
4+
# string color array
5+
PALETTE = %w(
6+
CLEAR
7+
WHITE
8+
BLACK
9+
LGREY
10+
GREY
11+
DGREY
12+
RED
13+
GREEN
14+
BLUE
15+
CYAN
16+
YELLOW
17+
MAGENTA
18+
).freeze
19+
# format string see fill below
20+
FSTRING = 'Java::HypeInterfaces::HConstants::%s'.freeze
321

4-
class ColorPresets < Propane::App
5-
6-
load_library :hype
7-
include_package 'hype'
8-
java_import 'hype.extended.layout.HGridLayout'
9-
# string color array
10-
PALETTE = %w(
11-
CLEAR
12-
WHITE
13-
BLACK
14-
LGREY
15-
GREY
16-
DGREY
17-
RED
18-
GREEN
19-
BLUE
20-
CYAN
21-
YELLOW
22-
MAGENTA
23-
).freeze
24-
# format string see fill below
25-
FSTRING = 'Java::HypeInterfaces::HConstants::%s'.freeze
26-
27-
def settings
28-
size(640, 640)
29-
end
30-
31-
def setup
32-
sketch_title 'Color Presets'
33-
H.init(self)
34-
H.background(color('#242424'))
35-
grid = HGridLayout.new(3).spacing(210, 157).start_loc(10, 10)
36-
PALETTE.each do |col|
37-
H.add(HRect.new(200, 147))
38-
.stroke_weight(3)
39-
.stroke(H::BLACK, 150.0) # Note we call hype constants
40-
.fill(instance_eval(format(FSTRING, col))) # and using eval
41-
.loc(grid.get_next_point)
42-
end
43-
end
22+
def settings
23+
size(640, 640)
24+
end
4425

45-
def draw
46-
H.draw_stage
47-
no_loop
26+
def setup
27+
sketch_title 'Color Presets'
28+
H.init(self)
29+
H.background(color('#242424'))
30+
grid = HGridLayout.new(3).spacing(210, 157).start_loc(10, 10)
31+
PALETTE.each do |col|
32+
H.add(HRect.new(200, 147))
33+
.stroke_weight(3)
34+
.stroke(H::BLACK, 150.0) # Note we call hype constants
35+
.fill(instance_eval(format(FSTRING, col))) # and using eval
36+
.loc(grid.get_next_point)
4837
end
4938
end
5039

51-
ColorPresets.new
40+
def draw
41+
H.draw_stage
42+
no_loop
43+
end

0 commit comments

Comments
 (0)