import groovy.swing.j2d.*
def gr = new GraphicsRenderer()
gr.renderToFile("sample816a.png", 200, 200){
 antialias("on")
 dolphinShape( x:0, y:20, width:200, height:160,
   borderColor: color("#103080"),
   borderWidth: 2
 ){
   radialGradient( cx: 100, cy: 100, radius:100){
     stop(offset: 0, color: "blue")
     stop(offset: 0.25, color: "green")
     stop(offset: 0.5, color: "yellow")
     stop(offset: 0.75, color: "orange")
     stop(offset: 1, color: "red")
   }
 }
}
出力画像(sample816a.png)

動作環境
Groovy1.6.0 Beta2, JDK1.6 Update11
関連項目
groovyで図形を虹色グラデーションで塗りつぶす
groovyでストロークにグラデーションをかける
groovyで図形をグラデーションで塗りつぶす
 
No comments:
Post a Comment