Back to project page GADemoGTM.
The source code is released under:
GNU General Public License
If you think the Android project GADemoGTM listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.pdro.gademogtm.tools; //w ww .j a v a 2 s . co m import android.graphics.Color; import java.util.Random; public class ColorWheel { private String currentColor; private void setCurrentColor(String colorToSet) { currentColor = colorToSet; } // Member variable (properties about the object) public String[] mColors = { "#39add1", "#3079ab", "#c25975", "#e15258", "#f9845b", "#838cc7", "#7d669e", "#53bbb4", "#51b46d", "#e0ab18", "#637a91", "#f092b0", "#b7c0c7" }; public int getColor() { String color = ""; // Randomly select a color Random randomGenerator = new Random(); // Construct a new Random number generator int randomNumber = randomGenerator.nextInt(mColors.length); color = mColors[randomNumber]; setCurrentColor(color); return Color.parseColor(color); } public String getCurrentColor() { return currentColor; } }