Class GoogleColor

java.lang.Object
org.deltava.util.color.GoogleColor
Direct Known Subclasses:
GoogleEarthColor, GoogleMapsColor

public abstract class GoogleColor extends Object
An abstract class to render RGB values as Google product colors.
Since:
1.0
Version:
6.0
Author:
Luke
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The transparency value.
    protected int
    The RGB blue value.
    protected int
    The RGB green value.
    protected int
    The RGB red value.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    GoogleColor(int red, int green, int blue, float alpha)
    Initializes the color bean
    protected
    GoogleColor(int red, int green, int blue, int alpha)
    Initializes the color bean.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static String
    formatHex(int value)
    Helper method to generate a hex string without 0x and two characters long.
    int
    Returns the transparency.
    int
    Returns the blue intensity.
    int
    Returns the green intensity.
    int
    Returns the red intensity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _blue

      protected int _blue
      The RGB blue value.
    • _green

      protected int _green
      The RGB green value.
    • _red

      protected int _red
      The RGB red value.
    • _alpha

      protected int _alpha
      The 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 255
      green - the geen intensity, from 0 to 255
      blue - the blue intensity, from 0 to 255
      alpha - 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 255
      green - the geen intensity, from 0 to 255
      blue - the blue intensity, from 0 to 255
      alpha - 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

      protected static String formatHex(int value)
      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