Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.graphics.Color;
import java.util.Random;

public class Main {
    public static int generateRandomColour(long seed) {
        Random random = new Random(seed);
        int color = Color.argb(random.nextInt(), random.nextInt(), random.nextInt(), random.nextInt());

        float[] hsv = new float[3];
        Color.colorToHSV(color, hsv);

        //Adjust the saturation value, less than 1 is darker, greater than 1 is brighter
        hsv[2] *= 0.8;
        return Color.HSVToColor(hsv);
    }
}