• Post Reply Bookmark Topic Watch Topic
  • New Topic

adjustRGB method  RSS feed

 
Tony Zucco
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i need to make an adjustRGB method for my class, which would let you adjust the red green and blue values. Im a little stumped, but here is the code i have so far... i don't know where to go now, or what to put in setRed, etc...

 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not really sure what you're trying to do here, are you just trying to change the red, green, and blue values of the class?

Hunter.
 
Tony Zucco
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have to create a method for a picture class that will be a filter that will allow you to change the amount of red, green, and blue in a picture to any values you want. if it worked one example would be pictureObj.adjustRGB(1.0, 0.0, 0.0) which would filter out the green and blue values in the picture.
 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
instead of changing the values wouldnt it be easier to just create a new picture object with the new values??

example:

 
Moojid Hamid
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from the code you posted it seems like you need to use your variable (r,g,b) and (redFactor, greenFactor, blueFactor) and pass the newly computed value to the set methods pix.setBlue(newlyComputedValueGoesHere);
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!