Skip to content

Commit 35b5a86

Browse files
committed
refactor hype examples
1 parent c98c5ea commit 35b5a86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+816
-252
lines changed

basics/color/colors_two.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def settings
1414

1515
def setup
1616
sketch_title 'Homage to Albers'
17-
# palette = web_to_color_array(['#CC6600', '#CC9900', '#993300'].to_java(:string))
18-
palette = web_to_color_array(['#CC6600', '#CC9900', '#993300'])
17+
# palette = from_web_array(['#CC6600', '#CC9900', '#993300'].to_java(:string))
18+
palette = from_web_array(['#CC6600', '#CC9900', '#993300'])
1919
# @redder = color 204, 102, 0
2020
# @yellower = color 204, 153, 0
2121
# @orangish = color 153, 51, 0

basics/color/creating_colors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def settings
1515

1616
def setup
1717
sketch_title 'Homage to Albers'
18-
palette = web_to_color_array(WEB)
18+
palette = from_web_array(WEB)
1919
@redder = palette[0]
2020
@yellower = palette[1]
2121
@orangish = palette[2]

data/wovns.png

60.2 KB
Loading

demo/arc_tesselation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def setup
2121
background 0
2222
sketch_title 'Arc Tesselation'
2323
# create a java primitive array of signed int
24-
# @cols = web_to_color_array(PALETTE)
25-
@group = ColorGroup.from_web_array(PALETTE)
24+
# @cols = from_web_array(PALETTE)
25+
@group = ColorGroup.from_web_array(PALETTE.to_java(:string)
2626
@cols = group.colors
2727
stroke_weight 1.5
2828
stroke_cap SQUARE

demo/fading.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Fading < Processing::App
1010

1111
def setup
1212
sketch_title 'Fading Arcs'
13-
@group = ColorGroup.from_web_array(PALETTE)
13+
@group = ColorGroup.from_web_array(PALETTE.to_java(:string)
1414
colors = group.colors
1515
background(group.last)
1616
no_stroke

external_library/gems/ruby_wordcram/fruits.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'ruby_wordcram'
44

55
# Literate colors from picrate
6-
# uses `web_to_color_array` to create a hash of fruity colors
6+
# uses `from_web_array` to create a hash of fruity colors
77
# to join two words as `cherry\ red` use back slash
88
class Fruits < Processing::App
99

@@ -17,7 +17,7 @@ def settings
1717
def setup
1818
sketch_title 'Fruity Colors'
1919
background(255)
20-
colors = FRUITS.zip(web_to_color_array(PALETTE)).to_h
20+
colors = FRUITS.zip(from_web_array(PALETTE)).to_h
2121
longest = FRUITS.max { |a, b| a.length <=> b.length }
2222
shortest = FRUITS.min { |a, b| a.length <=> b.length }
2323
words = FRUITS.map do |fruit|

external_library/java/handy/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The Handy Library by Jo Wood et al giCentre
2+
3+
The Handy library allows you to produce graphics with a hand-drawn appearance in Processing sketches. This can be customised to produce a variety of styles including pencil, watercolour and ink and marker pen appearance.
4+
5+
### Obtaining Library
6+
7+
Get it [here][web] install in `~/.picrate/libraries` or local to sketch
8+
9+
[web]:https://www.gicentre.net/handy

library/hype/Rakefile renamed to external_library/java/handy/Rakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 -r #{sample_name}", "r") do |io|
25+
open("|jruby #{sample_name}", "r") do |io|
2626
while l = io.gets
27-
puts(l.chop)
28-
end
27+
puts(l.chop)
28+
end
2929
end
3030
end
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)