/home/sjenks/NetBeansProjects/CS2/src/utilities/Random.java
 1 /*
 2  * To change this license header, choose License Headers in Project Properties.
 3  * To change this template file, choose Tools | Templates
 4  * and open the template in the editor.
 5  */
 6 package utilities;
 7 
 8 import java.awt.Color;
 9 import java.awt.Point;
10 
11 /**
12  *
13  * @author sjenks
14  */
15 public class Random {
16     
17     //return a random color 
18     static public Color color(){
19         int rv = (int) (Math.random()* 256);
20         int gv = (int) (Math.random()* 256);
21         int bv = (int) (Math.random()* 256);
22         return new Color (rv,gv,bv);
23     }
24     
25     //return a random point
26     public static Point point (int x, int y){
27         int a = number(x);
28         int b = number(y);
29         return new Point(a,b);
30     }
31 
32     private static int number(int x) {
33         return (int) Math.random()* x;
34     }
35     
36 }
37