Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Question 8 10 Points Consider the Processing sketch, to be run from the processing development environment operating in Java mode, and presented below: intrig,b; col_control

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Question 8 10 Points Consider the Processing sketch, to be run from the processing development environment operating in Java mode, and presented below: intrig,b; col_control redCon,greenCon,blueCon; color bkcol; void setup() { size(310,400); color Mode(RGB, 255, 255, 255); r = 0; 8 = 0; b = 0; bkcol=color(r.g,b); redCon=new col_control(10,10,90,50,r); greenCon=new col_control(110,10,90,50,g); blueCon=new col_control(210,10,90,50,b); } void draw() bkcol=color(rig,b); background(bkcol); redCon.draw(); blueCon.draw(); greenCon.draw(); } void mousePressed(){ r=redCon.checkcono; redCon.update(color(r,0,0),r); g=greenCon.checkcon(); greenCon.update(color(0.g,0).g); b=blueCon.checkcon(); blueCon.update(color(0,0,b),b); } void keyPressed { r = int(random(256)); redCon.update(color(r,0,0),r); g= int(random(256)); greenCon.update(color(0,g,0),g); b = int(random(256)); blueconundatelcolorino blb. *** class col_control control_arrow more,less; float x, y, wid, hi; int val; color concol;String lab; col_control(float mx,float my, float mywid, float myhi,int mval) less=new control_arrow(mx,my,mywid/3,3*myhi/5,false); more=new control_arrow(mx+2*mywid/3,my,mywid/3,3*myhi/5,tr ue); x=mx:y=my;wid=mywid;hi=myhi;val=mval; } void draw({ stroke(120); stroke(120); fill(concol); rect(x+wid/3.y,wid/3,3*hi/5); fill(120); rect(x,y+3*hi/5,wid,2*hi/5); fill(O); textAlign(CENTER); text(val,x+wid/2.7+4*hi/5); less.draw(); more.draw(); } void update(color nucint nuv){ concol=nuc; val=nuv; } int checkcon() { if (more.over(mouseX, mouseY)) { val=val+10; if (val>255) { val=255; } } if (less.over(mouseX, mouseY)) { val=val-10; if (valx&&nuxy&&nuY

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions