org.openmali.vecmath2.util
Class ColorUtils

java.lang.Object
  extended by org.openmali.vecmath2.util.ColorUtils

public final class ColorUtils
extends java.lang.Object

Methods to convert from hex to colors and vice versa.


Method Summary
static java.lang.String colorToHex(Colord color)
           
static java.lang.String colorToHex(Colorf color)
           
static Colorf hexToColor(java.lang.String hexStr)
           
static Colord hexToColor(java.lang.String hexStr, Colord out)
           
static Colorf hexToColor(java.lang.String hexStr, Colorf out)
           
static boolean hexToColor(java.lang.String hexStr, double[] buffer)
           
static boolean hexToColor(java.lang.String hexStr, float[] buffer)
           
static Colord hexToColord(java.lang.String hexStr)
           
static int hexToInt(char ch)
          Convertes the char interpreded as hex to its corresponding int.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hexToInt

public static final int hexToInt(char ch)
Convertes the char interpreded as hex to its corresponding int. Returns -1, if the char is not a hex char.

Parameters:
ch -
Returns:
the corresponding int or -1

hexToColor

public static final boolean hexToColor(java.lang.String hexStr,
                                       float[] buffer)

hexToColor

public static final Colorf hexToColor(java.lang.String hexStr,
                                      Colorf out)

hexToColor

public static final Colorf hexToColor(java.lang.String hexStr)

colorToHex

public static final java.lang.String colorToHex(Colorf color)

colorToHex

public static java.lang.String colorToHex(Colord color)

hexToColor

public static final boolean hexToColor(java.lang.String hexStr,
                                       double[] buffer)

hexToColor

public static final Colord hexToColor(java.lang.String hexStr,
                                      Colord out)

hexToColord

public static final Colord hexToColord(java.lang.String hexStr)