nl.tudelft.goal.ut2004.visualizer.timeline.map
Class GlColor

Package class diagram package GlColor
java.lang.Object
  extended by nl.tudelft.goal.ut2004.visualizer.timeline.map.GlColor

public class GlColor
extends Object

AWT provided Color class is not very suitable for OpenGl color manipulation so this class is supposed to remedy it.

Author:
Honza

Field Summary
 double a
          Alpha, 1 is fully opaque, 0 is fully transparent
 double b
           
 double g
           
 double r
           
 
Constructor Summary
GlColor(Color color)
          Create opaque color based on passed color.
GlColor(Color color, double alpha)
          Create GlColor based on passed Color and alpha
GlColor(double r, double g, double b)
          Create fully opaque GlColor.
GlColor(double r, double g, double b, double a)
          Create new GlColor
GlColor(GlColor color)
           
 
Method Summary
 GlColor getMixedWith(GlColor mixing, double portion)
          Create a mixed color from passed color and this color in following fashion:
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

r

public double r

g

public double g

b

public double b

a

public double a
Alpha, 1 is fully opaque, 0 is fully transparent

Constructor Detail

GlColor

public GlColor(double r,
               double g,
               double b,
               double a)
Create new GlColor

Parameters:
r - In range <0-1>
g - In range <0-1>
b - In range <0-1>
a - In range <0-1> 0 transparent, 1 opaque

GlColor

public GlColor(double r,
               double g,
               double b)
Create fully opaque GlColor.

Parameters:
r - In range <0-1>
g - In range <0-1>
b - In range <0-1>

GlColor

public GlColor(Color color,
               double alpha)
Create GlColor based on passed Color and alpha

Parameters:
color - Basic color
a - In range <0-1> 0 transparent, 1 opaque

GlColor

public GlColor(Color color)
Create opaque color based on passed color.

Parameters:
color -

GlColor

public GlColor(GlColor color)
Method Detail

getMixedWith

public GlColor getMixedWith(GlColor mixing,
                            double portion)
Create a mixed color from passed color and this color in following fashion:
this * (1-portion) + mixing * portion

Parameters:
mixing - Color that will be mixed with this one.
portion - how much of mixing color will be used
Returns:
Mixed color, not that this color won't be changed

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.