• Log in or sign up for an account here: https://www.sythe.org/login

Need help with easy java hw problem

Xeox

Forum Addict

Banned
Joined
Jun 17, 2010
Sythe Gold
0
Messages
357
Location
United States
Need help with easy java hw problem
The problem asks you to write a program DarkerDemo that constructs a Color object ( in my case the problem is telling me to make the object Color.RED), and apply the darker method twice, then print the red, green, and blue values of the resulting color (wont be able to actually see the color).

Can anyone help me out here?

***I am programming using BlueJay***
 
Need help with easy java hw problem
I'm a little confused as to what exactly you are trying to do.

I would need more information or a clearer explanation.
 
Need help with easy java hw problem
alright i know I didnt explain it that well...

basically I need to create a color using the 0-255 color scale (or whatever you call it), I need to then make it darker by using the 'darker' method, and then I need to write the program to tell me what the new color scale numbers would be.

For example...
i input the color (255, 0, 255)
The program makes this color darker...
then tells me the new color in number form.
 
Need help with easy java hw problem
Code:
Color myColor = new Color(255,0,255);
myColor.darken();
myColor.darken();
System.out.println(myColor.getColor());

It should probably look something like this, aside from names etc. When you darken a color, each R/G/B value decreases. Do you understand how to go about it now?
 
Need help with easy java hw problem
yea thanks =)

I went wrong when I was typing in the darker method...I used

Color.darken();
instead of myColor.darken();

=\
 
Runescape Gamblingrunescape gambling
Back
Top