Ji : Drawing tool & Importing an image

 

1. Drawing tool

http://www.openprocessing.org/sketch/113337

스크린샷 2013-10-02 오후 9.29.58

For my drawing tool, I used triangles on white background. Originally I tried to make the color change from yellow to purple and it was working on Java. but after export and uploading, the color changed like that which looks nice and fancy. I like that colorful drawing that I got unintentionally more than original one!

2. Image

http://www.openprocessing.org/sketch/113338

스크린샷 2013-10-02 오후 9.30.14

I imported just a random image form my laptop, and this photo was taken at Hirshhorn Museum in Washington DC where I went last summer.

For Code:

1. Drawing toolfloat x;
float y;
float lerp;
int r;
int g;
int b;

boolean colorchange;

void setup() {
size(500,500);
background(250);
colorchange= false;
}

void draw() {
noStroke ();
x=mouseX;
y=mouseY;
color from = color(255,123,0);
color to = color(74,0,191);
color interA = lerpColor(from, to, lerp);
fill(interA);
if (!colorchange) {
lerp-=0.1;}
else if (colorchange) {
lerp-=0.1;}
if (lerp <=0.001 || lerp >=0.999)
{colorchange =!colorchange;
}

if (mousePressed==true) {
triangle(x, y, x-10, y-20, x+10, y-20);

}
}2. Image
PImage img;

void setup() {
size(480, 800);
img = loadImage(“museum.jpg”);
}

void draw() {
image(img, 0, 0);
}