changing a color variable to a tint?
in
Programming Questions
•
10 months ago
I have a color variable to change the color of an object using a keyPress but I wanted to change that object into a Pimage is there a way I could make a tint variable?
color c; // variable to store the current color
void draw() {
// draw ellipse at mouse location with the current color and no stroke
noStroke();
fill(c);
ellipse(mouseX,mouseY,80,80);
}
void keyPressed() {
if (key == 'b') { c = color(0); } // press b to make the current color black
if (key == 'w') { c = color(255); } // press w to make current color white
}
1