Skip to content

Commit d3b88c8

Browse files
committed
fix sketches
1 parent 64c8f8a commit d3b88c8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

demo/arc_tesselation.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def setup
2020
background 0
2121
sketch_title 'Arc Tesselation'
2222
# create a java primitive array of signed int
23-
# @cols = from_web_array(PALETTE)
24-
@group = ColorGroup.from_web_array(PALETTE.to_java(:string)
23+
# @cols = web_to_color_array(PALETTE)
24+
@group = ColorGroup.from_web_array(PALETTE.to_java(:string))
2525
@cols = group.colors
2626
stroke_weight 1.5
2727
stroke_cap SQUARE
@@ -31,6 +31,7 @@ def setup
3131

3232
def draw
3333
arc_pattern
34+
no_loop
3435
end
3536

3637
def sep_index(idx, length)
@@ -62,16 +63,17 @@ def arc_pattern
6263
end
6364
pop_matrix
6465
end
65-
no_loop
6666
end
6767

6868
def mouse_pressed
69+
loop
6970
group.shuffle! if coloured
7071
@cols = group.colors
71-
puts group.ruby_code # prints out current web colors as ruby code
72-
loop
72+
puts group.ruby_string # prints out current web colors as an array of String
7373
end
7474

75+
76+
7577
def key_typed
7678
case key
7779
when 'c', 'C'

demo/recursive_pentagon.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
require 'picrate'
42

53
# After an openprocessing sketch by C.Andrews
@@ -10,7 +8,7 @@ class RecursivePentagons < Processing::App
108
def setup
119
sketch_title 'Recursive Pentagons'
1210
@strut_factor = 0.2
13-
@renderer = GfxRender.new self # so we can send Vec2D :to_vertex
11+
@renderer = GfxRender.new g # so we can send Vec2D :to_vertex
1412
group = ColorGroup.from_web_array(PALETTE.to_java(:string))
1513
@cols = group.colors
1614
no_loop

0 commit comments

Comments
 (0)