Class GoogleColor
java.lang.Object
org.deltava.util.color.GoogleColor
- Direct Known Subclasses:
GoogleEarthColor
An abstract class to render RGB values as Google product colors.
- Since:
- 1.0
- Version:
- 6.0
- Author:
- Luke
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGoogleColor(int red, int green, int blue, float alpha) Initializes the color beanprotectedGoogleColor(int red, int green, int blue, int alpha) Initializes the color bean. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringformatHex(int value) Helper method to generate a hex string without 0x and two characters long.intgetAlpha()Returns the transparency.intgetBlue()Returns the blue intensity.intgetGreen()Returns the green intensity.intgetRed()Returns the red intensity.
-
Field Details
-
_blue
protected int _blueThe RGB blue value. -
_green
protected int _greenThe RGB green value. -
_red
protected int _redThe RGB red value. -
_alpha
protected int _alphaThe transparency value.
-
-
Constructor Details
-
GoogleColor
protected GoogleColor(int red, int green, int blue, int alpha) Initializes the color bean.- Parameters:
red- the red intensity, from 0 to 255green- the geen intensity, from 0 to 255blue- the blue intensity, from 0 to 255alpha- the transparency, from 0 to 255
-
GoogleColor
protected GoogleColor(int red, int green, int blue, float alpha) Initializes the color bean- Parameters:
red- the red intensity, from 0 to 255green- the geen intensity, from 0 to 255blue- the blue intensity, from 0 to 255alpha- the transparancy, as a fraction between 0 and 1
-
-
Method Details
-
getRed
public int getRed()Returns the red intensity.- Returns:
- the red intensity value, from 0 to 255
-
getGreen
public int getGreen()Returns the green intensity.- Returns:
- the green intensity value, from 0 to 255
-
getBlue
public int getBlue()Returns the blue intensity.- Returns:
- the blue intensity value, from 0 to 255
-
getAlpha
public int getAlpha()Returns the transparency.- Returns:
- the transparency value, from 0 to 255
-
formatHex
Helper method to generate a hex string without 0x and two characters long.- Parameters:
value- the RGB value- Returns:
- the hex representation of the value, with a leading zero if required
-