The ColorPicker button pops up a ColorSelectionDialog and allows a color to
be selected. The button changes color to match the currently selected color.
The colors can be set using doubles - values between 0.0 and 1.0, 8 bit
integers - values between 0 and 255, and 16 bit integers - values between 0
and 65535.
addListener
public void addListener(ColorPickerListener listener)
Register an object to handle ColorPicker events.
getAlpha16Bit
public int getAlpha16Bit()
Get the alpha of the color as a 16 bit value between 0 and 65535.
getAlpha8Bit
public int getAlpha8Bit()
Get the alpha of the color as a 8 bit value between 0 and 255.
getAlphaDouble
public double getAlphaDouble()
Get the alpha of the color as a double value between 0.0 and 1.0.
getAlphaEnabled
public boolean getAlphaEnabled()
Returns whether ColorPicker uses alpha.
- True if alpha is used. Otherwise, false.
getBlue16Bit
public int getBlue16Bit()
Get the blue element of the color as a 16 bit value between 0 and 65535.
- The blue element of the color.
getBlue8Bit
public int getBlue8Bit()
Get the blue element of the color as a 8 bit value between 0 and 255.
- The blue element of the color.
getBlueDouble
public double getBlueDouble()
Get the blue element of the color as a double value between 0.0 and 1.0.
- The blue element of the color.
getDitherEnabled
public boolean getDitherEnabled()
Returns whether ColorPicker uses dither.
- True if dither is used. Otherwise, false.
getEventListenerClass
public Class getEventListenerClass(String signal)
getEventType
public EventType getEventType(String signal)
getGreen16Bit
public int getGreen16Bit()
Get the green element of the color as a double value between 0 and 65535.
- The green element of the color.
getGreen8Bit
public int getGreen8Bit()
Get the green element of the color as a double value between 0 and 255.
- The green element of the color.
getGreenDouble
public double getGreenDouble()
Get the green element of the color as a double value between 0.0 and 1.0.
- The green element of the color.
getRed16Bit
public int getRed16Bit()
Get the red element of the color as a double value between 0 and 65535.
- The red element of the color.
getRed8Bit
public int getRed8Bit()
Get the red element of the color as a double value between 0 and 255.
- The red element of the color.
getRedDouble
public double getRedDouble()
Get the red element of the color as a double value between 0.0 and 1.0.
- The red element of the color.
getTitle
public String getTitle()
Gets the title of the color picker.
- The title for the color picker.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
setAlpha16Bit
public void setAlpha16Bit(int alpha)
throws IllegalArgumentException
Set the alpha of the color as a 16 bit value between 0 and 65535.
alpha
- The alpha of the color.
setAlpha8Bit
public void setAlpha8Bit(int alpha)
throws IllegalArgumentException
Set the alpha of the color as a 8 bit value between 0 and 255.
alpha
- The alpha of the color.
setAlphaDouble
public void setAlphaDouble(double alpha)
throws IllegalArgumentException
Set the alpha of the color as a double value between 0.0 and 1.0.
alpha
- The alpha of the color.
setAlphaEnabled
public void setAlphaEnabled(boolean enable)
Sets whether ColorPicker is to use alpha.
enable
- True to use alpha. Otherwise, false.
setBlue16Bit
public void setBlue16Bit(int color)
throws IllegalArgumentException
Set the blue element of the color as a 16 bit value between 0 and 65535.
color
- The blue element of the color.
setBlue8Bit
public void setBlue8Bit(int color)
throws IllegalArgumentException
Set the blue element of the color as a 8 bit value between 0 and 255.
color
- The blue element of the color.
setBlueDouble
public void setBlueDouble(double color)
throws IllegalArgumentException
Set the blue element of the color as a double value between 0.0 and 1.0.
color
- The blue element of the color.
setColor16Bit
public void setColor16Bit(int alpha,
int blue,
int green,
int red)
throws IllegalArgumentException
A shortcut method to set all the color values with one call. All values
must be a integer value between 0 and 65535.
alpha
- The alpha of the color.blue
- The blue element of the color.green
- The green element of the color.red
- The red element of the color.
setColor8Bit
public void setColor8Bit(int alpha,
int blue,
int green,
int red)
throws IllegalArgumentException
A shortcut method to set all the color values with one call. All values
must be a integer value between 0 and 255.
alpha
- The alpha of the color.blue
- The blue element of the color.green
- The green element of the color.red
- The red element of the color.
setColorDouble
public void setColorDouble(double alpha,
double blue,
double green,
double red)
throws IllegalArgumentException
A shortcut method to set all the color values with one call. All values
must be a double value between 0.0 and 1.0.
alpha
- The alpha of the color.blue
- The blue element of the color.green
- The green element of the color.red
- The red element of the color.
setDitherEnabled
public void setDitherEnabled(boolean enable)
Sets whether ColorPicker is to use dither.
enable
- True to use dither. Otherwise, false.
setGreen16Bit
public void setGreen16Bit(int color)
throws IllegalArgumentException
Set the green element of the color as a integer value between 0 and
65535.
color
- The green element of the color.
setGreen8Bit
public void setGreen8Bit(int color)
throws IllegalArgumentException
Set the green element of the color as a integer value between 0 and 255.
color
- The green element of the color.
setGreenDouble
public void setGreenDouble(double color)
throws IllegalArgumentException
Set the green element of the color as a double value between 0.0 and 1.0.
color
- The green element of the color.
setRed16Bit
public void setRed16Bit(int color)
throws IllegalArgumentException
Set the red element of the color as a integer value between 0 and 65535.
color
- The red element of the color.
setRed8Bit
public void setRed8Bit(int color)
throws IllegalArgumentException
Set the red element of the color as a integer value between 0 and 255.
color
- The red element of the color.
setRedDouble
public void setRedDouble(double color)
throws IllegalArgumentException
Set the red element of the color as a double value between 0.0 and 1.0.
color
- The red element of the color.
setTitle
public void setTitle(String title)
Sets the title of the color picker.
title
- The title for the color picker.