net.avh4.util
Class Util

java.lang.Object
  extended by net.avh4.util.Util

public class Util
extends Object


Constructor Summary
Util()
           
 
Method Summary
static int getContrastingColor(int color)
          Get a color that visually contrasts with the given color.
static int getHashColor(String string)
          Generates a pseudo-random color given a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getHashColor

public static int getHashColor(String string)
Generates a pseudo-random color given a string. This will always return the same color for the same string, even across multiple runs of the JVM.


getContrastingColor

public static int getContrastingColor(int color)
Get a color that visually contrasts with the given color. This can be used for selecting a text color given an unknown background color.



Copyright © 2011. All Rights Reserved.