Here you can find the source of generateColorFromString(String seed)
public static int generateColorFromString(String seed)
//package com.java2s; /**/*w w w . ja v a 2 s. c om*/ * This class was created by <Vazkii>. It's distributed as * part of the ReCubed Mod. * * ReCubed is Open Source and distributed under a * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * * File Created @ [Dec 13, 2013, 4:18:48 PM (GMT)] */ import java.awt.Color; import java.util.Random; public class Main { public static int generateColorFromString(String seed) { Random rand = new Random(seed.hashCode()); int red = rand.nextInt(256); int green = rand.nextInt(256); int blue = rand.nextInt(256); return new Color(red, green, blue).getRGB(); } }