org.openmali.vecmath2.util
Class ColorUtil

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

public final class ColorUtil
extends java.lang.Object

Methods to convert from hex to colors and vice versa.

Author:
Marvin Froehlich (aka Qudus)

Method Summary
static java.lang.String colorToHex(Colorf color)
           
static Colorf hexToColor(java.lang.String hexStr)
           
static Colorf hexToColor(java.lang.String hexStr, Colorf out)
           
static void hexToColor(java.lang.String hexStr, float[] buffer)
           
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 void 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)