«test test test silly gfx patch» by s2s2s2s2s

on 17 Jun'22 21:03 in

romanessco

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// romanescoesque                                                                                                                                                                             
(
        var wi = 400, he = 400;
        var window = Window( "", Rect(100,100,wi+20,he+20) ).front;
        var view = UserView( window,Rect(10,10,wi,he) ).canFocus_(false);
        
        
        var c1 = Color.green( 0.2 ).alpha_( 0.1 ),c2 = Color.green, numSteps = 64, cstep = reciprocal( numSteps-1 );


        var point = Point(wi/2,he/2);
        var rect1 = Rect.aboutPoint( point, 10,10 );
        var rect2 = Rect.aboutPoint( point, 140,140 );
        var xstep = ( rect2.width-rect1.width ) / 2 / ( numSteps -1 );
        var ystep = ( rect2.height-rect1.height ) / 2 / ( numSteps -1 );

        view.drawFunc = { |v|
                var b0 = v.bounds.moveTo( 0,0 );
                Color.black.set;
                Pen.fillRect( b0 );



                Pen.width = 1;

                do( numSteps, { |i|
                        blend( c1,c2, i*cstep ).set;
                        Pen.use({
                                Pen.rotate( pi * 4 / (numSteps-1) * i, wi/2,he/2 );
                                Pen.fillRect( rect2.insetBy( i*xstep, i*ystep ) )
                        })
                        // Color.grey.set;
                        // Pen.strokeRect( rect2.insetBy( i*xstep, i*ystep ) );
                })

        }
)
raw 1484 chars (focus & ctrl+a+c to copy)
reception
comments