> i am doing stuff with java turtles and it doesn't
> come with certain colors. Can anyone help me find a
> way to make new colors by using the rgb with the
> numbers 0 - 255 and that stuff
What do you need to know? There are lots of color charts, and it isn't so hard to learn how to mix R, G, B so that you get the color that you want.
Kaj
public class Turtle extends Object
{public static final double DEGREE = Math.PI / 180;
public static final int WIDTH = 760, HEIGHT = 600;
public static final Color RED = Color.red, BLUE = Color.blue,
BLACK = Color.black,GRAY = Color.gray,
YELLOW = Color.yellow,PINK = Color.pink,
ORANGE = Color.orange,GREEN = Color.green,
MAGENTA = Color.magenta, WHITE = Color.white,
LIGHT_GRAY = Color.lightGray,
TURTLE_GREEN = Color.darkGreen;
Color darkGreen = new Color(22, 114, 41);
that is the code from Turtle.java and i'm trying to figure out how to make a Dark Green where I can switch to it by doing
turtleName.switchTo(Turtle.DARK_GREEN);
public class Turtle extends Object
{ public static final double DEGREE = Math.PI / 180;
public static final int WIDTH = 760, HEIGHT = 600;
public static final Color RED = Color.red, BLUE = Color.blue,
BLACK = Color.black, GRAY = Color.gray,
YELLOW = Color.yellow, PINK = Color.pink,
ORANGE = Color.orange, GREEN = Color.green,
MAGENTA = Color.magenta, WHITE = Color.white,
LIGHT_GRAY = Color.lightGray,
TURTLE_GREEN = Color.darkGreen;
Color darkGreen = new Color(22, 114, 41);
that is the code from Turtle.java and i'm trying to figure out how to make a Dark Green where I can switch to it by doing
turtleName.switchTo(Turtle.DARK_GREEN);
Answer: Make it:
Color DARK_GREEN = new Color(22, 114, 41);
Notice that those colors are a long string of "constant" definitions.
I would prefer to write them individually:
...
public static final Color TURTLE_GREEN = Color.GREEN;
public static final Color DARK_GREEN = new Color(22, 114, 41);