图片附件: 游客没有浏览图片的权限,请
登录 或
注册
程序代码:
import java.awt.Color;
import acm.graphics.GOval;
import acm.program.GraphicsProgram;
public class COLOTEST extends GraphicsProgram {
public void run(){
Color 透明色=new Color(1,1,1,0);
Color c=new Color(Color.GREEN.getRed(),Color.GREEN.getGreen(),Color.GREEN.getBlue(),100);
GOval goval1=new GOval(150,150,80,80);
goval1.setFilled(true);
goval1.setColor(透明色);
goval1.setFillColor(c);
Color c2=new Color(Color.RED.getRed(),Color.RED.getGreen(),Color.RED.getBlue(),150);
GOval goval2=new GOval(180,180,150,150);
goval2.setFilled(true);
goval2.setColor(透明色);
goval2.setFillColor(c2);
Color c3=new Color(Color.ORANGE.getRed(),Color.ORANGE.getGreen(),Color.ORANGE.getBlue(),200);
GOval goval3=new GOval(205,205,200,200);
goval3.setFilled(true);
goval3.setColor(透明色);//去掉黑边
goval3.setFillColor(c3);//填充图形色
add(goval3);
add(goval2);
add(goval1);
}
}