Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.libsdl.video
Class SDLRGB  view SDLRGB download SDLRGB.java

java.lang.Object
  extended byorg.libsdl.video.SDLRGB
Direct Known Subclasses:
SDLRGBA

public class SDLRGB
extends java.lang.Object

The SDLColor class represents an RGB color. The class encompasses a color that has red, green, and blue short components to it.

------ EXAMPLE ------

     SDLRGB red = new SDLRGB(255, 0, 0);
     SDLRGB green = new SDLRGB(0, 255, 0);
     SDLRGB blue = new SDLRGB(0, 0, 255);
 

------ EXAMPLE ------

     int pixel = ... // get a 32 bit integer pixel value
     SDLPixelFormat format = ...  // get pixel format (from SDLSurface maybe)
     SDLRGB rgb = format.getRGB(pixel);
 

Version:
$revision$

Field Summary
private  short b
           
private  short g
           
private  short r
           
 
Constructor Summary
SDLRGB(short r, short g, short b)
          Constructs a new SDLRGB with the given red, green, and blue components.
 
Method Summary
 short blue()
          Get the blue component from this SDLRGB object.
 short green()
          Get the green component from this SDLRGB object.
 short red()
          Get the red component from this SDLRGB object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

r

private short r

g

private short g

b

private short b
Constructor Detail

SDLRGB

public SDLRGB(short r,
              short g,
              short b)
Constructs a new SDLRGB with the given red, green, and blue components.

Method Detail

red

public short red()
Get the red component from this SDLRGB object.


green

public short green()
Get the green component from this SDLRGB object.


blue

public short blue()
Get the blue component from this SDLRGB object.