Skip to content

Commit 5432aa5

Browse files
committed
update toxiclibs sketch
1 parent 99f82ba commit 5432aa5

File tree

9 files changed

+2736
-48
lines changed

9 files changed

+2736
-48
lines changed

external_library/gem/toxiclibs/color_utils/color_theme.rb

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,5 @@
1-
# ColorTheme demo showing the following:
2-
# - construction of TColor themes via textual descriptions of shades and Colors
3-
# - adding an rand element to the theme
4-
#
5-
# Press SPACE to toggle rendering mode, any other key will re-generate a
6-
# random variation of the color theme
7-
#
8-
# @author Karsten Schmidt <info at postspectacular dot com>
9-
# Copyright (c) 2009 Karsten Schmidt
10-
#
11-
# This demo & library is free software you can redistribute it and/or
12-
# modify it under the terms of the GNU Lesser General Public
13-
# License as published by the Free Software Foundation either
14-
# version 2.1 of the License, or (at your option) any later version.
15-
#
16-
# http://creativecommons.org/licenses/LGPL/2.1/
17-
#
18-
# This library is distributed in the hope that it will be useful,
19-
# but WITHOUT ANY WARRANTY without even the implied warranty of
20-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21-
# Lesser General Public License for more details.
22-
#
23-
# You should have received a copy of the GNU Lesser General Public
24-
# License along with this library if not, write to the Free Software
25-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
261

272
require 'toxiclibs'
28-
include_package 'toxi.color'
29-
include_package 'toxi.util.datatypes'
303

314
SWATCH_HEIGHT = 40.0
325
SWATCH_WIDTH = 5.0
@@ -50,15 +23,15 @@ def setup
5023

5124
def draw
5225
# first define our new theme
53-
t = ColorTheme.new('test')
26+
t = Toxi::ColorTheme.new('test')
5427
# add different color options, each with their own weight
5528
t.add_range('soft ivory', 0.5)
5629
t.add_range('intense goldenrod', 0.25)
5730
t.add_range('warm saddlebrown', 0.15)
5831
t.add_range('fresh teal', 0.05)
5932
t.add_range('bright yellowgreen', 0.05)
6033
# now add another rand hue which is using only bright shades
61-
t.add_range(ColorRange::BRIGHT, TColor.new_random, rand(0.02..0.05))
34+
t.add_range(Toxi::ColorRange::BRIGHT, TColor.new_random, rand(0.02..0.05))
6235
# use the TColor theme to create a list of 160 Colors
6336
list = t.get_colors(160)
6437
if show_discs
@@ -70,19 +43,19 @@ def draw
7043
list.sort_by_distance(false)
7144
swatches(list, 32, yoff)
7245
yoff += SWATCH_HEIGHT + 10
73-
list.sort_by_criteria(AccessCriteria::LUMINANCE, false)
46+
list.sort_by_criteria(Toxi::AccessCriteria::LUMINANCE, false)
7447
swatches(list, 32, yoff)
7548
yoff += SWATCH_HEIGHT + 10
76-
list.sort_by_criteria(AccessCriteria::BRIGHTNESS, false)
49+
list.sort_by_criteria(Toxi::AccessCriteria::BRIGHTNESS, false)
7750
swatches(list, 32, yoff)
7851
yoff += SWATCH_HEIGHT + 10
79-
list.sort_by_criteria(AccessCriteria::SATURATION, false)
52+
list.sort_by_criteria(Toxi::AccessCriteria::SATURATION, false)
8053
swatches(list, 32, yoff)
8154
yoff += SWATCH_HEIGHT + 10
82-
list.sort_by_criteria(AccessCriteria::HUE, false)
55+
list.sort_by_criteria(Toxi::AccessCriteria::HUE, false)
8356
swatches(list, 32, yoff)
8457
yoff += SWATCH_HEIGHT + 10
85-
list.sort_by_proximity_to(NamedColor::WHITE, RGBDistanceProxy.new, false)
58+
list.sort_by_proximity_to(Toxi::NamedColor::WHITE, RGBDistanceProxy.new, false)
8659
swatches(list, 32, yoff)
8760
end
8861
# save_frame(format('theme-%s%s', timestamp, '_##.png'))

processing_app/basics/web/embedded_links.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Loading URLs.
2-
#
1+
# Loading URLs.
2+
#
33
# Click on the left button to open a different URL in the same window (Only
4-
# works online). Click on the right button to open a URL in a new browser window.
4+
# works online). Click on the right button to open a URL in a new browser window.
55

66
def setup
7-
sketch_title 'Embedded Links'
7+
sketch_title 'Embedded Links'
88
end
99

1010
def draw
11-
background 204
11+
background 204
1212
no_fill
1313
fill 255 if @over_left_button
1414
rect 20, 60, 75, 75
@@ -22,12 +22,12 @@ def draw
2222
end
2323

2424
def mouse_pressed
25-
link 'https://github.com/jashkenas/JRubyArt/wiki' if @over_left_button
26-
link 'https://github.com/jashkenas/JRubyArt/wiki' if @over_right_button
25+
link 'https://github.com/ruby-processing/JRubyArt/' if @over_left_button
26+
link 'https://github.com/ruby-processing/JRubyArt/wiki' if @over_right_button
2727
end
2828

29-
def mouse_moved
30-
check_buttons
29+
def mouse_moved
30+
check_buttons
3131
end
3232

3333
def mouse_dragged

processing_app/library/file_chooser/data/data.cfdg

Lines changed: 2712 additions & 0 deletions
Large diffs are not rendered by default.
542 KB
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CF::Background = [b -1]
2+
startshape haddock
3+
shape dot{CIRCLE[]}
4+
import data.cfdg
76.8 KB
Loading

processing_app/library/file_chooser/pixellator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def setup
1717
resizable
1818
fill 0, 0, 200
1919
text('Click Window to Load Image', 10, 100)
20-
@skip = 20 # controls apparent resolution
20+
@skip = 5 # controls apparent resolution
2121
@data = []
2222
@poster = 0
2323
end

processing_app/library/vecmath/vec2d/toxi_aabb_test.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ def settings
7070

7171
# Use class to contatins_point block behaviour
7272
class Block
73-
attr_reader :aabb
73+
attr_reader :aabb
7474

7575
def initialize(a, b)
7676
@aabb = Toxi::Rect.new(a, b)
77-
end
77+
end
7878

7979
def move(vec)
8080
if yield
@@ -86,4 +86,3 @@ def over?(vec)
8686
aabb.contains_point vec
8787
end
8888
end
89-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Some sketches in this folder may need to be run with the "--nojruby" flag. eg threads_two.rb, and word_frequency.rb the load_json.rb relies json or json-ruby gem.
1+
The load_json.rb relies json or json-ruby gem.

0 commit comments

Comments
 (0)