Need help with easy java hw problem

Discussion in 'Programming General' started by Xeox, Sep 19, 2010.

Need help with easy java hw problem
  1. Unread #1 - Sep 19, 2010 at 3:09 PM
  2. Xeox
    Joined:
    Jun 17, 2010
    Posts:
    357
    Referrals:
    0
    Sythe Gold:
    0

    Xeox Forum Addict
    Banned

    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***
     
  3. Unread #2 - Sep 19, 2010 at 4:43 PM
  4. blindkilla
    Joined:
    Jun 22, 2005
    Posts:
    1,896
    Referrals:
    0
    Sythe Gold:
    6
    Discord Unique ID:
    282000633404456960
    Discord Username:
    sogord

    blindkilla Guru
    $25 USD Donor New

    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.
     
  5. Unread #3 - Sep 19, 2010 at 5:10 PM
  6. Xeox
    Joined:
    Jun 17, 2010
    Posts:
    357
    Referrals:
    0
    Sythe Gold:
    0

    Xeox Forum Addict
    Banned

    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.
     
  7. Unread #4 - Sep 19, 2010 at 10:04 PM
  8. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    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?
     
  9. Unread #5 - Sep 20, 2010 at 2:13 PM
  10. Xeox
    Joined:
    Jun 17, 2010
    Posts:
    357
    Referrals:
    0
    Sythe Gold:
    0

    Xeox Forum Addict
    Banned

    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();

    =\
     
  11. Unread #6 - Sep 21, 2010 at 8:47 AM
  12. Xeox
    Joined:
    Jun 17, 2010
    Posts:
    357
    Referrals:
    0
    Sythe Gold:
    0

    Xeox Forum Addict
    Banned

    Need help with easy java hw problem

    This thread can be closed I got my answer
     
< VB 2010 mouse positions | Easy question, I'm just starting >

Users viewing this thread
1 guest


 
 
Adblock breaks this site