package express.lines;

import java.awt.Graphics;
import java.awt.Color;

public class Line001 extends ChangingColorLine  {

	double circleRadius;
	int t=0;

	public Line001(int x, int y, long t, Color lineColor) {
		
		super(x,y,t,lineColor);
		circleRadius = 500;
			
	}
	
	public void drawLinePieces( Graphics g, int x1, int y1, int x2, int y2) {

		int r1 = (int)(Math.random()*17);
		int r2 = (int)(Math.random()*18);
		g.drawOval(x1-(int)circleRadius/2, y1-(int)circleRadius/2, (int)circleRadius+r1, (int)circleRadius+r2);
		g.drawOval(x1-(int)circleRadius/2+1, y1-(int)circleRadius/2+1, (int)circleRadius+r1-2, (int)circleRadius+r2-2);
		g.drawOval(x1-(int)circleRadius/2+2, y1-(int)circleRadius/2+2, (int)circleRadius+r1-4, (int)circleRadius+r2-4);
		
	}
	
	public Color changeColor(long currentTime) {

		circleRadius=circleRadius-10;
		if (t<1) {t =t+1;}

		R = (int)(R+t);
		if (R > 255) {R = 255;}

		G = (int)(G+t);
		if (G > 255) {G = 255;}

		B = (int)(B+t);
		if (B > 255) {B = 255;}
		
		if (circleRadius<40) {living = false;}
		
		lineColor = new Color(R,G,B);
		return lineColor;	
	}
}
