seeded Color - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

seeded Color

Demo Code


//package com.java2s;
import java.awt.*;
import java.util.*;

public class Main {
    public static void main(String[] argv) throws Exception {
        int seed = 2;
        System.out.println(seededColor(seed));
    }//from w  w w.j  av a2 s.co  m

    public static Color seededColor(int seed) {
        Random r = new Random(seed);
        return new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255));
    }
}

Related Tutorials