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
3333attr_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
5454end
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
7373def settings
7474 size ( 256 , 256 , P2D )
7575end
76-
0 commit comments