int K = 2;
int L1 = 1;
int P1 = 0;
int L2 = 3;
int P2 = 4;
color k1,k2,l1,l2,p1,p2,l3,l4,p3,p4,len,len2,ban,ban2;
void setup(){
size(500,500);
background(145, 209, 189);
k1=color(255,70,64);
k2=color(194,53,48);
l1=color(255,65,59);
l2=color(255,55,50);
p1=color(200,45,50);
p2=color(200,30,30);
l3=color(245,55,49);
l4=color(245,45,40);
p3=color(190,35,40);
p4=color(190,20,20);
len=color(227,189,52);
len2=color(217,179,62);
ban=color(237,199,62);
noLoop();
}
void draw(){
setGradient(150,190,350,150, k1, k2, K); // ΠΊΡΠΈΡΠΊΠ° quad(250,150,350,190,250,230,150,190);
setGradient(150,190,250,230, l1, l2, L1); //Π»ΡΠ²Π° ΠΊΡΠΈΡΠΊΠ°
setGradient(250,230,350,190, p1, p2, P1); //ΠΏΡΠ°Π²Π° ΠΊΡΠΈΡΠΊΠ°
setGradient(160,215,250,272, l3, l4, L2); //Π»ΡΠ²Π° ΡΡΡΠ½ΠΊΠ°
setGradient(250,251,340,190, p3, p4, P2); //ΠΏΡΠ°Π²Π° ΡΡΡΠ½ΠΊΠ°
//Π»Π΅Π½ΡΠ°
noStroke();
fill(len);
quad(190,173,210,165,310,206,290,214); //Π·Π»ΡΠ²Π°-Π½Π°ΠΏΡΠ°Π²ΠΎ ΠΊΡΠΈΡΠΊΠ°
quad(293,165,313,173,210,214,190,206); //ΡΠΏΡΠ°Π²Π°-Π½Π°Π»ΡΠ²ΠΎ ΠΊΡΠΈΡΠΊΠ°
quad(190,205,210,213,210,234,190,226); //Π»ΡΠ²Π° ΠΊΡΠΈΡΠΊΠ°
quad(290,212,310,205,310,226,290,234); //ΠΏΡΠ°Π²Π° ΠΊΡΠΈΡΠΊΠ°
fill(len2);
quad(195,227,215,235,215,317,195,310); //Π»ΡΠ²Π° ΡΡΡΠ½ΠΊΠ°
quad(285,235,305,227,305,310,285,318); //ΠΏΡΠ°Π²Π° ΡΡΡΠ½ΠΊΠ°
//Π±Π°Π½ΡΠΈΠΊ
fill(ban);
noStroke();
//ΠΏΡΠ°Π²Π° Π·Π°Π²ΠΈΡΡΡ
Π°
int x=250;
float y=0;
int r=20;
int z=205;
float df= 2PI/18;
for (float f=df; f<2PI; f += df)
{
x = x+3;
y = z - sin(f) * r;
ellipse( x, y, 20, 20);
z=z+2;
}
//Π»ΡΠ²Π° Π·Π°Π²ΠΈΡΡΡ
Π°
int x1=250;
int z1=205;
float y1;
float df1= 2PI/18;
for (float f1=df1; f1<2PI; f1 += df1)
{
x1 = x1-3;
y1 = z1 - sin(f1) * r;
ellipse( x1, y1, 20, 20);
z1=z1+2;
}
stroke(len2);
circle(230,190,40); //Π»ΡΠ²Π° ΡΠ°ΡΡΠΈΠ½Π°
circle(270,190,40); //ΠΏΡΠ°Π²Π° ΡΠ°ΡΡΠΈΠ½Π°
circle(250,190,30); //ΡΠ΅Π½Ρ Π±Π°Π½ΡΠ°
//ΠΏΡΡΠ»Ρ Π½Π°ΡΠΈΡΠΊΠ°Π½Π½Ρ
}
void mousePressed() {
background(145, 209, 189);
fill(22, 135, 31);
triangle(250,10,300,60,200,60);
triangle(250,30,320,100,180,100);
triangle(250,50,340,140,160,140);
}
//ΠΊΡΠΈΡΠΊΠ°
void setGradient(int x, int y,float w, float h, color z1, color z2, int ax ) {
noFill();
if (ax == K) {
float k3=map(x, y, h, 0, 0.4);
float k31=k3;
for (int i = x; i <= w; i++) {
float inter = map(i, x, w, 0, 1);
color k = lerpColor(z1, z2, inter);
stroke(k);
line(i, y-k31, i, y+k31);
if (i <= w-100) {
k31=k31+k3;}
else {
k31=k31-k3;}
}
}
else if (ax==L1) {
float k3=map(x, y, h, 0, 0.4);
float k31=k3;
for (int i = x; i <= w; i++) {
float inter = map(i, x, w, 0, 1);
color k = lerpColor(z1, z2, inter);
stroke(k);
line(i, y-k31,i,y-k31+20);
k31=k31+k3;
}
}
else if (ax==P1) {
float k3=map(x, y, h, 0, 0.8);
float k31=k3;
for (int i = x; i <= w; i++) {
float inter = map(i, x, w, 0, 1);
color k = lerpColor(z1, z2, inter);
stroke(k);
line(i, y-k31,i,y-k31+20);
k31=k31-k3;
}
}
else if (ax==L2) {
float k3=map(x, y, h, 0, 0.4);
float k31=k3;
for (int i = x; i <= w; i++) {
float inter = map(i, x, w, 0, 1);
color k = lerpColor(z1, z2, inter);
stroke(k);
line(i, y-k31,i,y-k31+80);
k31=k31+k3;
}
}
else if (ax==P2) {
float k3=map(x, h, y, 0, 0.4);
float k31=k3;
for (int i = x; i <= w; i++) {
float inter = map(i, x, w, 0, 1);
color k = lerpColor(z1, z2, inter);
stroke(k);
line(i, y-k31,i,y-k31+80);
k31=k31+k3;
}
}
}