sdljava.video

Class SDLColor

public class SDLColor extends 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
intalpha
intblue
intgreen
intred
Constructor Summary
SDLColor()
SDLColor(int red, int green, int blue)
SDLColor(int red, int green, int blue, int alpha)
Method Summary
intgetAlpha()
Gets the value of alpha
intgetBlue()
Gets the value of blue
intgetGreen()
Gets the value of green
intgetRed()
Gets the value of red
voidsetAlpha(int argAlpha)
Sets the value of alpha
voidsetBlue(int argBlue)
Sets the value of blue
voidsetGreen(int argGreen)
Sets the value of green
voidsetRed(int argRed)
Sets the value of red
StringtoString()

Field Detail

alpha

int alpha

blue

int blue

green

int green

red

int red

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

getAlpha

public int getAlpha()
Gets the value of alpha

Returns: the value of alpha

getBlue

public int getBlue()
Gets the value of blue

Returns: the value of blue

getGreen

public int getGreen()
Gets the value of green

Returns: the value of green

getRed

public int getRed()
Gets the value of red

Returns: the value of red

setAlpha

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

Parameters: argAlpha Value to assign to this.alpha

setBlue

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

Parameters: argBlue Value to assign to this.blue

setGreen

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

Parameters: argGreen Value to assign to this.green

setRed

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

Parameters: argRed Value to assign to this.red

toString

public String toString()