Skip to content

Commit 3030ac9

Browse files
committed
no need to prefix TColor
1 parent 910284b commit 3030ac9

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

external_library/gem/toxiclibs/color_utils/color_theme.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def draw
5555
t.add_range('fresh teal', 0.05)
5656
t.add_range('bright yellowgreen', 0.05)
5757
# now add another rand hue which is using only bright shades
58-
t.add_range(Toxi::ColorRange::BRIGHT, Toxi::TColor.new_random, rand(0.02..0.05))
58+
t.add_range(Toxi::ColorRange::BRIGHT, TColor.new_random, rand(0.02..0.05))
5959
# use the TColor theme to create a list of 160 Colors
6060
@list = t.get_colors(160)
6161
if show_discs

external_library/gem/toxiclibs/color_utils/palette_generator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def settings
77
end
88

99
def setup
10-
sketch_title 'Monochrome and Complement Blue Swatch'
11-
@mono = Toxi::MonochromeTheoryStrategy.new.create_list_from_color(Toxi::TColor::BLUE)
12-
@complement = Toxi::ComplementaryStrategy.new.create_list_from_color(Toxi::TColor::BLUE)
10+
sketch_title 'Monochrome and Complementary Blue Swatches'
11+
@mono = Toxi::MonochromeTheoryStrategy.new.create_list_from_color(TColor::BLUE)
12+
@complement = Toxi::ComplementaryStrategy.new.create_list_from_color(TColor::BLUE)
1313
render_palette(mono)
1414
render_palette(complement, 200)
1515
end

external_library/gem/toxiclibs/simulation/ca_ornament.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
require 'toxiclibs'
3131
include_package 'toxi.sim.automata'
3232
include_package 'toxi.math'
33-
include_package 'toxi.color'
33+
3434
attr_reader :ca, :tone_map
3535

3636
def settings
@@ -60,17 +60,17 @@ def setup
6060
# create initial seed pattern
6161
ca.draw_box_at(0, height / 2, 5, 1)
6262
# create a gradient for rendering/shading the CA
63-
grad = ColorGradient.new
63+
grad = Toxi::ColorGradient.new
6464
# NamedColors are preset colors, but any TColor can be added
6565
# see javadocs for list of names:
66-
# http://toxiclibs.org/docs/colorutils/toxi/color/NamedColor::html
67-
grad.add_color_at(0, NamedColor::BLACK)
68-
grad.add_color_at(64, NamedColor::CYAN)
69-
grad.add_color_at(128, NamedColor::YELLOW)
70-
grad.add_color_at(192, NamedColor::WHITE)
71-
grad.add_color_at(255, NamedColor::BLACK)
66+
# http://toxiclibs.org/docs/colorutils/toxi/color/NamedColor.html
67+
grad.add_color_at(0, Toxi::NamedColor::BLACK)
68+
grad.add_color_at(64, Toxi::NamedColor::CYAN)
69+
grad.add_color_at(128, Toxi::NamedColor::YELLOW)
70+
grad.add_color_at(192, Toxi::NamedColor::WHITE)
71+
grad.add_color_at(255, Toxi::NamedColor::BLACK)
7272
# the tone map will map cell states/ages to a gradient color
73-
@tone_map = ToneMap.new(0, rule.get_state_count - 1, grad)
73+
@tone_map = Toxi::ToneMap.new(0, rule.get_state_count - 1, grad)
7474
end
7575

7676
def draw

external_library/gem/toxiclibs/simulation/gray_scott_tone_map.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@
1616
# modify it under the terms of the GNU Lesser General Public
1717
# License as published by the Free Software Foundation either
1818
# version 2.1 of the License, or (at your option) any later version.
19-
#
19+
#
2020
# http://creativecommons.org/licenses/LGPL/2.1/
21-
#
21+
#
2222
# This library is distributed in the hope that it will be useful,
2323
# but WITHOUT ANY WARRANTY without even the implied warranty of
2424
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2525
# Lesser General Public License for more details.
26-
#
26+
#
2727
# You should have received a copy of the GNU Lesser General Public
2828
# License along with this library if not, write to the Free Software
2929
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3030
#
3131

32-
NUM_ITERATIONS = 10
32+
NUM_ITERATIONS = 10
3333
attr_reader :gs, :tone_map
3434

35-
def setup
35+
def setup
3636
sketch_title 'Gray Scott Tone Map'
3737
@gs = Simulation::GrayScott.new width, height, false
3838
@gs.set_coefficients 0.021, 0.076, 0.12, 0.06
3939
# create a color gradient for 256 values
4040
grad = Toxi::ColorGradient.new
4141
# NamedColors are preset colors, but any TColor can be added
4242
# see javadocs for list of names:
43-
# http://toxiclibs.org/docs/colorutils/toxi/color/NamedColor::html
43+
# http://toxiclibs.org/docs/colorutils/toxi/color/NamedColor.html
4444
# NB: use '::' in place of '.' here for these java constants
4545
grad.add_color_at(0, Toxi::NamedColor::BLACK)
4646
grad.add_color_at(128, Toxi::NamedColor::RED)
@@ -53,7 +53,7 @@ def setup
5353
@tone_map = Toxi::ToneMap.new 0, 0.33, grad
5454
end
5555

56-
def draw
56+
def draw
5757
@gs.set_rect(mouse_x, mouse_y, 20, 20) if mouse_pressed?
5858
load_pixels
5959
# update the simulation a few time steps
@@ -73,4 +73,3 @@ def key_pressed
7373
def settings
7474
size(256,256, P2D)
7575
end
76-

0 commit comments

Comments
 (0)