org.gnu.gdk

Class Color


public class Color
extends Boxed

Describes an allocated or unallocated color.

Field Summary

static Color
BLACK
static Color
BLUE
static Color
GREEN
static Color
ORANGE
static Color
RED
static Color
WHITE
static Color
YELLOW

Fields inherited from class org.gnu.glib.Boxed

handle

Constructor Summary

Color(int red, int green, int blue)
Creates an sRGB color with the specified red, green, and blue values in the range (0 - 65535).
Color(Handle handle)
Construct a Color object from a handle to a native resource.

Method Summary

Object
clone()
Makes a copy of this color.
boolean
equals(Object color)
Determines whether another object is equal to this Color.
protected void
finalize()
protected static Handle
gdk_color_copy(Handle color)
protected static boolean
gdk_color_equal(Handle colora, Handle colorb)
protected static void
gdk_color_free(Handle color)
protected static int
gdk_color_get_type()
protected static int
gdk_color_hash(Handle colora)
protected static int
gdk_color_parse(String spec, Handle color)
int
getBlue()
Returns the blue component in the range 0-65535 in the default sRGB space.
protected static int
getBlue(Handle obj)
int
getGreen()
Returns the green component in the range 0-65535 in the default sRGB space.
protected static int
getGreen(Handle obj)
protected static int
getPixel(Handle obj)
int
getRed()
Returns the red component in the range 0-65535 in the default sRGB space.
protected static int
getRed(Handle obj)
int
hashCode()
static Color
parse(String spec)
Parses a textual specification of a color.
protected static void
setBlue(Handle obj, int blue)
void
setBlue(short value)
Sets the blue component in the range of 0-65535.
protected static void
setGreen(Handle obj, int green)
void
setGreen(short value)
Sets the green component in the range of 0-65535.
protected static void
setRed(Handle obj, int red)
void
setRed(short value)
Sets the red component in the range of 0-65535.
String
toString()
Returns a string representation of this Color.

Methods inherited from class org.gnu.glib.Boxed

equals, getHandle, hashCode, setHandle

Field Details

BLACK

public static final Color BLACK


BLUE

public static final Color BLUE


GREEN

public static final Color GREEN


ORANGE

public static final Color ORANGE


RED

public static final Color RED


WHITE

public static final Color WHITE


YELLOW

public static final Color YELLOW

Constructor Details

Color

public Color(int red,
             int green,
             int blue)
Creates an sRGB color with the specified red, green, and blue values in the range (0 - 65535).


Color

public Color(Handle handle)
Construct a Color object from a handle to a native resource.

Method Details

clone

public Object clone()
Makes a copy of this color.


equals

public boolean equals(Object color)
Determines whether another object is equal to this Color.
Overrides:
equals in interface Boxed


finalize

protected void finalize()


gdk_color_copy

protected static final Handle gdk_color_copy(Handle color)


gdk_color_equal

protected static final boolean gdk_color_equal(Handle colora,
                                               Handle colorb)


gdk_color_free

protected static final void gdk_color_free(Handle color)


gdk_color_get_type

protected static final int gdk_color_get_type()


gdk_color_hash

protected static final int gdk_color_hash(Handle colora)


gdk_color_parse

protected static final int gdk_color_parse(String spec,
                                           Handle color)


getBlue

public int getBlue()
Returns the blue component in the range 0-65535 in the default sRGB space.


getBlue

protected static final int getBlue(Handle obj)


getGreen

public int getGreen()
Returns the green component in the range 0-65535 in the default sRGB space.


getGreen

protected static final int getGreen(Handle obj)


getPixel

protected static final int getPixel(Handle obj)


getRed

public int getRed()
Returns the red component in the range 0-65535 in the default sRGB space.


getRed

protected static final int getRed(Handle obj)


hashCode

public int hashCode()
Overrides:
hashCode in interface Boxed


parse

public static Color parse(String spec)
Parses a textual specification of a color. The text string can be in any of the forms accepted by XParseColor; these include name for a color from rgb.txt, such as DarkSlateGray or a hex specification such as 305050.

Parameters:
spec -


setBlue

protected static final void setBlue(Handle obj,
                                    int blue)


setBlue

public void setBlue(short value)
Sets the blue component in the range of 0-65535.


setGreen

protected static final void setGreen(Handle obj,
                                     int green)


setGreen

public void setGreen(short value)
Sets the green component in the range of 0-65535.


setRed

protected static final void setRed(Handle obj,
                                   int red)


setRed

public void setRed(short value)
Sets the red component in the range of 0-65535.


toString

public String toString()
Returns a string representation of this Color.