de.lessvoid.nifty.tools
Class Alpha

java.lang.Object
  extended by de.lessvoid.nifty.tools.Alpha

public class Alpha
extends Object

Alpha helper class to manage alpha values.

Author:
void

Field Summary
static Alpha FULL
           
static Alpha ZERO
           
 
Constructor Summary
Alpha(float newAlpha)
           
Alpha(String color)
           
 
Method Summary
 float getAlpha()
          get alpha value.
 Alpha linear(Alpha end, float t)
          linear interpolate between this color and the given color.
 Alpha mutiply(float factor)
          Multiply all components with the given factor.
 void setAlpha(float newColorAlpha)
          Set color alpha.
 String toString()
          convert color to string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Alpha ZERO

FULL

public static final Alpha FULL
Constructor Detail

Alpha

public Alpha(String color)

Alpha

public Alpha(float newAlpha)
Method Detail

linear

public Alpha linear(Alpha end,
                    float t)
linear interpolate between this color and the given color.

Parameters:
end - end color
t - t in [0,1]
Returns:
linear interpolated color

getAlpha

public final float getAlpha()
get alpha value.

Returns:
alpha

mutiply

public Alpha mutiply(float factor)
Multiply all components with the given factor.

Parameters:
factor - factor to multiply
Returns:
new Color with factor applied

toString

public String toString()
convert color to string.

Overrides:
toString in class Object
Returns:
string representation

setAlpha

public void setAlpha(float newColorAlpha)
Set color alpha.

Parameters:
newColorAlpha - new color alpha


Copyright © 2012. All Rights Reserved.