sdljava.video
Class SDLColor

java.lang.Object
  extended by sdljava.video.SDLColor

public class SDLColor
extends java.lang.Object

SDLColor describes a color in a format independent way. You can convert a SDLColor to a pixel value for a certain pixel format using Video.mapRGB

Note: On the java side alpha was added to this class so that the return value from SDL_MapRGBA can be easily accommodated. Otherwise the value is meaningless and can safely be ignore

Also see the documentation here: SDL_Color

Version:
$Id: SDLColor.java,v 1.7 2004/12/24 17:32:17 ivan_ganza Exp $
Author:
Ivan Z. Ganza

Field Summary
(package private)  int alpha
           
(package private)  int blue
           
(package private)  int green
           
(package private)  int red
           
 
Constructor Summary
SDLColor()
           
SDLColor(int red, int green, int blue)
           
SDLColor(int red, int green, int blue, int alpha)
           
 
Method Summary
 int getAlpha()
          Gets the value of alpha
 int getBlue()
          Gets the value of blue
 int getGreen()
          Gets the value of green
 int getRed()
          Gets the value of red
 void setAlpha(int argAlpha)
          Sets the value of alpha
 void setBlue(int argBlue)
          Sets the value of blue
 void setGreen(int argGreen)
          Sets the value of green
 void setRed(int argRed)
          Sets the value of red
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

red

int red

green

int green

blue

int blue

alpha

int alpha
Constructor Detail

SDLColor

public SDLColor()

SDLColor

public SDLColor(int red,
                int green,
                int blue)

SDLColor

public SDLColor(int red,
                int green,
                int blue,
                int alpha)
Method Detail

getRed

public int getRed()
Gets the value of red

Returns:
the value of red

setRed

public void setRed(int argRed)
Sets the value of red

Parameters:
argRed - Value to assign to this.red

getGreen

public int getGreen()
Gets the value of green

Returns:
the value of green

setGreen

public void setGreen(int argGreen)
Sets the value of green

Parameters:
argGreen - Value to assign to this.green

getBlue

public int getBlue()
Gets the value of blue

Returns:
the value of blue

setBlue

public void setBlue(int argBlue)
Sets the value of blue

Parameters:
argBlue - Value to assign to this.blue

getAlpha

public int getAlpha()
Gets the value of alpha

Returns:
the value of alpha

setAlpha

public void setAlpha(int argAlpha)
Sets the value of alpha

Parameters:
argAlpha - Value to assign to this.alpha

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object