Question
How do I get my javascript code to work, it says Unexpected token } var img = new SimpleImage(hilton.jpg); var w = img.getWidth(); print(w); print(img);
How do I get my javascript code to work, it says Unexpected token }
var img = new SimpleImage("hilton.jpg"); var w = img.getWidth(); print(w); print(img);
for (var pixel of img.values()); } } if (pixel.getX() < img.getWidth()/3) // set pixels to red
pixel.setRed(255); pixel.setGreen(255); pixel.setBlue(255); } else if (pixel.img < img.getWidth()/ 3 && pixel.img > img.getWidth()/3*2) // set pixels to green } pixel.setGreen(255); pixel.setRed(0); pixel.setBlue(0); } else if (pixel.img > (img.getWidth()/3*2) // set pixels to Blue } pixel.setBlue(255); pixel.setRed(0); pixel.setGreen(0); } print(img); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started