Приложение 3. Шары

gml [
#    w 600
    w 800
    h 800
    start {
        stop = {
            linearGradient215 = {
                stop = {
                    { offset=0.000000;color="#ff003d";opacity=0.36471 },
                    { offset=1.000000;color="#ff0a9a";opacity=0 }
                }
            },
            linearGradient192 = {
                stop = {
                    { offset=0.000000;color="#0c0f25";opacity=1 },
                    { offset=1.000000;color="#ffffff";opacity=0 }
                }
            },
            linearGradient176 = {
                stop = {
                    { offset=0.000000;color="#174517";opacity=0.19608 },
                    { offset=1.000000;color="#ffff00";opacity=0 }
                }
            },
            linearGradient172 = {
                stop = {
                    { offset=0.000000;color="#ffff00";opacity=1 },
                    { offset=1.000000;color="#555500";opacity=0.99216 }
                }
            },
            linearGradient152 = {
                stop = {
                    { offset=0.000000;color="#0a00e5";opacity=1 },
                    { offset=1.000000;color="#150d15";opacity=0.99216 }
                }
            },
            linearGradient142 = {
                stop = {
                    { offset=0.000000;color="#05007d";opacity=0.18431 },
                    { offset=1.000000;color="#ff0aff";opacity=0 }
                }
            },
            linearGradient134 = {
                stop = {
                    { offset=0.000000;color="#758d7f";opacity=1 },
                    { offset=1.000000;color="#050000";opacity=1 }
                }
            },
            linearGradient112 = {
                stop = {
                    { offset=0.000000;color="#fff7ff";opacity=1 },
                    { offset=1.000000;color="#ffffff";opacity=0 }
                }
            },
            linearGradient109 = {
                stop = {
                    { offset=0.000000;color="#ff0000";opacity=1 },
                    { offset=1.000000;color="#270d00";opacity=0.99216 }
                }
            },
            linearGradient105 = {
                stop = {
                    { offset=0.000000;color="#05007d";opacity=0.63529 },
                    { offset=1.000000;color="#ff00ff";opacity=0 }
                }
            }
	}
	radial = {
            radialGradient108 = {
                r=1.07716;
                cx=0.78906;
                cy=0.21094;
                fx=0.78906;
                fy=0.21094;
		units="object";
                spread="pad";
                stop=stop.linearGradient109.stop
            },
            radialGradient116 = {
		r=0.5;
		cx=0.5;
		cy=0.5;
		units="object";
                stop=stop.linearGradient112.stop
            },
            radialGradient119 = {
                r=0.97502;
                cx=0.94181;
                cy=0.37201;
                fx=0.94181;
                fy=0.37201;
		units="object";
                spread="pad";
                stop=stop.linearGradient105.stop
            },
            radialGradient133 = {
                r=0.5;
                cx=0.5;
                cy=0.5;
                fx=0.5;
                fy=0.5;
		units="object";
                spread="pad";
                stop=stop.linearGradient192.stop
            },
            radialGradient138 = {
                r=0.98555;
                cx=0.79687;
                cy=0.17969;
                fx=0.79687;
                fy=0.17969;
		units="object";
                spread="pad";
                stop=stop.linearGradient134.stop
            },
            radialGradient155 = {
                r=1.07716;
                cx=0.78906;
                cy=0.21094;
                fx=0.78906;
                fy=0.21094;
		units="object";
                spread="pad";
                stop=stop.linearGradient152.stop
            },
            radialGradient175 = {
                r=1.07716;
                cx=0.78906;
                cy=0.21094;
                fx=0.78906;
                fy=0.21094;
		units="object";
                spread="pad";
                stop=stop.linearGradient172.stop
            },
            radialGradient223 = {
                r=0.32868;
                cx=0.14217;
                cy=0.60734;
                fx=0.14217;
                fy=0.60734;
		units="object";
                spread="pad";
                stop=stop.linearGradient176.stop
            }
	}
	linear = {
            linearGradient120 = {
                x1=-0.25216;
                y1=0.68701;
                x2=0.6765;
                y2=-0.0286434;
		units="object";
                spread="pad";
                stop=stop.linearGradient105.stop
            },
            linearGradient121 = {
                x1=0.23325;
                y1=0.73002;
                x2=0.6307;
                y2=0.46853;
		units="object";
                spread="pad";
                stop=stop.linearGradient176.stop
            },
            linearGradient140 = {
                x1=0.21014;
                y1=0.72204;
                x2=0.51122;
                y2=0.41895;
		units="object";
                spread="pad";
                stop=stop.linearGradient142.stop
            },
            linearGradient141 = {
                x1=0.46616;
                y1=0.17708;
                x2=0.46241;
                y2=0.91667;
		units="object";
                spread="pad";
                stop=stop.linearGradient142.stop
            },
            linearGradient145 = {
                x1=-0.25216;
                y1=0.68701;
                x2=0.6765;
                y2=-0.0286436;
		units="object";
                spread="pad";
                stop=stop.linearGradient142.stop
            },
            linearGradient179 = {
                x1=0.37061;
                y1=0.66815;
                x2=0.61712;
                y2=0.47695;
		units="object";
                spread="pad";
                stop=stop.linearGradient176.stop
            },
            linearGradient218 = {
                x1=0.083336;
                y1=0.17187;
                x2=0.54762;
                y2=0.61719;
		units="object";
                spread="pad";
                stop=stop.linearGradient215.stop
            },
            linearGradient227 = {
                x1=0.18974;
                y1=0.76763;
                x2=0.58444;
                y2=0.52573;
		units="object";
                spread="pad";
                stop=stop.linearGradient105.stop
            }
        }

	function linear.get( self, name)
	    local x1, y1 = self [name].x1, self [name].y1
	    local x2, y2 = self [name].x2, self [name].y2
	    local units = self [name].units
	    local spread = self [name].spread
	    local transform = self [name].transform

	    local n = table.getn( self [name].stop)

	    local grad = luajava.newInstance( "org.ussr.luagml.GMLgradient")
	    grad:setUnits( units) ;
	    grad:linear( n, x1, y1, x2, y2, spread, transform)

	    for i = 1, n  do
		local stop = self [name].stop [i]

		grad:append( stop.offset, stop.color, stop.opacity)
	    end

	    return grad:get()
	end

	function radial.get( self, name)
	    local cx, cy = self [name].cx, self [name].cy
	    local fx, fy = self [name].fx, self [name].fy
	    local r = self [name].r
	    local units = self [name].units
	    local spread = self [name].spread
	    local transform = self [name].transform

	    if fx == nil then fx = cx end
	    if fy == nil then fy = cy end

	    local n = table.getn( self [name].stop)

	    local grad = luajava.newInstance( "org.ussr.luagml.GMLgradient")
	    grad:setUnits( units) ;
	    grad:radial( n, cx, cy, r, fx, fy, spread, transform)

	    for i = 1, n  do
		local stop = self [name].stop [i]

		grad:append( stop.offset, stop.color, stop.opacity)
	    end

	    return grad:get()
	end
    }
    g [ transform "translate( 0, -300)"
        path [
            transform "matrix(0.31989,0,0,0.31989,260.059,485.514)"
            style "font-size 12 fill { return radial:get('radialGradient138')} fill-rule 'evenodd' stroke-width 1.26082"
            d "M 732.473145 654.318420 A 261.727356 261.727356 0 1 0 209.018433,654.318420 A 261.727 261.727 0 1 0 732.473 654.318 L 470.745789 654.318420 z"
        ]
        path [
            transform "matrix(0.38754,-0.0969747,0.12329,0.30483,210.932,471.518)"
            style "font-size 12 fill { return linear:get('linearGradient140')} fill-rule 'evenodd' stroke-width 0"
            d "M 71.25 776.112 C 55 972.31 237.5 1041.7 276.25 1004.86 C 102.5 909.039 140 793.321 92.5 738.612 C 79.2737 734.862 71.2812 763.087 71.25 776.112 z "
        ]
        path [
            transform "matrix(0.23555,0,0,0.29202,362.135,541.917)"
    	    style "font-size 12 fill { return linear:get('linearGradient141')} fill-rule 'evenodd' stroke-width 1"
    	    d "M 378.750000 629.862183 A 86.250000 86.250000 0 1 0 206.250000,629.862183 A 86.25 86.25 0 1 0 378.75 629.862 L 292.500000 629.862183 z"
	]
	path [
    	    transform "matrix(0.53393,-0.41373,0.44565,0.49569,-227.712,695.883)"
    	    style "font-size 12 fill { return radial:get('radialGradient116')} fill-opacity 0.65068 fill-rule 'evenodd' stroke-width 1"
    	    d "M 612.500000 542.987183 A 26.250000 41.875000 0 1 0 560.000000,542.987183 A 26.25 41.875 0 1 0 612.5 542.987 L 586.250000 542.987183 z"
	]
	path [
    	    transform "matrix(-1.53527,0.13448,-5.73096,-1.89741,6466.87,2655.2)"
    	    style "fill-rule 'evenodd' stroke 'none' fill { return radial:get('radialGradient133')} fill-opacity 1 stroke-opacity 1 stroke-width 1 stroke-linejoin 'miter' stroke-linecap 'butt'"
    	    d "M 470.000000 965.487183 A 170.000000 25.625000 0 1 0 130.000000,965.487183 A 170 25.625 0 1 0 470 965.487 L 300.000000 965.487183 z"
	]
	path [
    	    transform "matrix(-1.53527,0.13448,-5.73096,-1.89741,6264.37,2665.2)"
    	    style "fill-rule 'evenodd' stroke 'none' fill { return radial:get('radialGradient133')} fill-opacity 1 stroke-opacity 1 stroke-width 1 stroke-linejoin 'miter' stroke-linecap 'butt'"
    	    d "M 470.000000 965.487183 A 170.000000 25.625000 0 1 0 130.000000,965.487183 A 170 25.625 0 1 0 470 965.487 L 300.000000 965.487183 z"
	]
	path [
    	    transform "matrix(-1.53527,0.13448,-5.73096,-1.89741,6349.37,2731.45)"
    	    style "fill-rule 'evenodd' stroke 'none' fill { return radial:get('radialGradient133')} fill-opacity 1 stroke-opacity 1 stroke-width 1 stroke-linejoin 'miter' stroke-linecap 'butt'"
    	    d "M 470.000000 965.487183 A 170.000000 25.625000 0 1 0 130.000000,965.487183 A 170 25.625 0 1 0 470 965.487 L 300.000000 965.487183 z"
	]
	g [
    	    transform "translate(361.25,-23.75)"
    	    path [
        	transform "matrix(0.37674,0,0,0.37674,-9.72698,548.437)"
        	style "font-size 12 fill { return radial:get('radialGradient155')} fill-rule 'evenodd' stroke-width 1"
        	d "M 732.473145 654.318420 A 261.727356 261.727356 0 1 0 209.018433,654.318420 A 261.727 261.727 0 1 0 732.473 654.318 L 470.745789 654.318420 z"
    	    ]
    	    path [
        	transform "matrix(0.51002,-0.3952,0.42569,0.47349,-314.746,716.694)"
        	style "font-size 12 fill { return radial:get('radialGradient116')} fill-opacity 0.65068 fill-rule 'evenodd' stroke-width 1"
        	d "M 612.500000 542.987183 A 26.250000 41.875000 0 1 0 560.000000,542.987183 A 26.25 41.875 0 1 0 612.5 542.987 L 586.250000 542.987183 z"
    	    ]
    	    path [
        	transform "matrix(0.45641,-0.11421,0.1452,0.35901,-66.696,537.259)"
        	style "font-size 12 fill { return linear:get('linearGradient120')} fill-opacity 0.65098 fill-rule 'evenodd' stroke { return radial:get('radialGradient119')} stroke-width 0"
        	d "M 71.25 776.112 C 55 972.31 237.5 1041.7 276.25 1004.86 C 102.5 909.039 140 793.321 92.5 738.612 C 79.2737 734.862 71.2812 763.087 71.25 776.112 z "
    	    ]
	]
	path [
    	    transform "matrix(0.37674,0,0,0.37674,105.273,527.187)"
    	    style "font-size 12 fill { return radial:get('radialGradient108')} fill-rule 'evenodd' stroke-width 1"
    	    d "M 732.473145 654.318420 A 261.727356 261.727356 0 1 0 209.018433,654.318420 A 261.727 261.727 0 1 0 732.473 654.318 L 470.745789 654.318420 z"
	]
	path [
    	    transform "matrix(-0.90612,0.0273766,0.27582,0.29074,201.183,536.714)"
    	    style "font-size 12 fill { return linear:get('linearGradient227')} fill-opacity 0.65098 fill-rule 'evenodd' stroke { return radial:get('radialGradient119')} stroke-width 0"
    	    d "M 71.25 776.112 C 55 972.31 237.5 1041.7 276.25 1004.86 C 102.5 909.039 140 793.321 92.5 738.612 C 79.2737 734.862 71.2812 763.087 71.25 776.112 z "
	]
	path [
    	    transform "matrix(0.34415,-1.05521,0.40886,0.76788,-158.479,256.084)"
    	    style "font-size 12 fill { return linear:get('linearGradient121')} fill-opacity 0.65098 fill-rule 'evenodd' stroke 'none' stroke-width 0"
    	    d "M 71.25 776.112 C 55 972.31 237.5 1041.7 276.25 1004.86 C 102.5 909.039 140 793.321 92.5 738.612 C 79.2737 734.862 71.2812 763.087 71.25 776.112 z "
	]
	path [
    	    transform "matrix(0.37674,0,0,0.37674,225.273,608.437)"
    	    style "font-size 12 fill { return radial:get('radialGradient175')} fill-rule 'evenodd' stroke-width 1"
    	    d "M 732.473145 654.318420 A 261.727356 261.727356 0 1 0 209.018433,654.318420 A 261.727 261.727 0 1 0 732.473 654.318 L 470.745789 654.318420 z"
	]
	path [
    	    transform "matrix(0.51002,-0.3952,0.42569,0.47349,-79.746,776.694)"
    	    style "font-size 12 fill { return radial:get('radialGradient116')} fill-opacity 0.65068 fill-rule 'evenodd' stroke-width 1"
    	    d "M 612.500000 542.987183 A 26.250000 41.875000 0 1 0 560.000000,542.987183 A 26.25 41.875 0 1 0 612.5 542.987 L 586.250000 542.987183 z"
	]
	path [
    	    transform "matrix(0.35897,-0.48469,0.42646,0.35708,-37.7636,657.841)"
    	    style "font-size 12 fill { return linear:get('linearGradient121')} fill-opacity 0.65098 fill-rule 'evenodd' stroke 'none' stroke-width 0"
    	    d "M 71.25 776.112 C 55 972.31 237.5 1041.7 276.25 1004.86 C 102.5 909.039 140 793.321 92.5 738.612 C 79.2737 734.862 71.2812 763.087 71.25 776.112 z "
	]
	path [
    	    transform "matrix(-0.35141,0,0,0.32825,473.194,499.721)"
    	    style "font-size 12 fill { return linear:get('linearGradient218')} fill-rule 'evenodd' stroke-width 1"
    	    d "M 378.750000 629.862183 A 86.250000 86.250000 0 1 0 206.250000,629.862183 A 86.25 86.25 0 1 0 378.75 629.862 L 292.500000 629.862183 z"
	]
	path [
    	    transform "matrix(0.51002,-0.3952,0.42569,0.47349,-202.246,701.694)"
    	    style "font-size 12 fill { return radial:get('radialGradient116')} fill-opacity 0.65068 fill-rule 'evenodd' stroke-width 1"
    	    d "M 612.500000 542.987183 A 26.250000 41.875000 0 1 0 560.000000,542.987183 A 26.25 41.875 0 1 0 612.5 542.987 L 586.250000 542.987183 z"
	]
	path [
    	    transform "matrix(0.28131,-0.21867,0.2348,0.26199,154.235,645.546)"
    	    style "font-size 12 fill { return radial:get('radialGradient116')} fill-opacity 0.65068 fill-rule 'evenodd' stroke-width 1"
    	    d "M 612.500000 542.987183 A 26.250000 41.875000 0 1 0 560.000000,542.987183 A 26.25 41.875 0 1 0 612.5 542.987 L 586.250000 542.987183 z"
	]
    ]
]