Class ColorConstant

java.lang.Object
org.eclipse.graphiti.util.ColorConstant
All Implemented Interfaces:
IColorConstant

public class ColorConstant extends Object implements IColorConstant
The Class ColorConstant.
  • Constructor Details

    • ColorConstant

      public ColorConstant(int red, int green, int blue)
      Creates a new ColorConstant given the desired red, green and blue values expressed as ints in the range 0 to 255 (where 0 is black and 255 is full brightness).
      Parameters:
      red - the amount of red in the color
      green - the amount of green in the color
      blue - the amount of blue in the color
    • ColorConstant

      public ColorConstant(String hexRGBString)
      Creates a new ColorConstant for for a given String, which defines the RGB values in hexadecimal format. This means, that the String must have a length of 6 characters. Example: getColor("FF0000") returns a red color.
      Parameters:
      hexRGBString - The RGB values in hexadecimal format.
      Since:
      0.8
  • Method Details

    • getRed

      public int getRed()
      Description copied from interface: IColorConstant
      Returns the amount of red in the color, from 0 to 255.
      Specified by:
      getRed in interface IColorConstant
      Returns:
      the red component of the color
    • getGreen

      public int getGreen()
      Description copied from interface: IColorConstant
      Returns the amount of green in the color, from 0 to 255.
      Specified by:
      getGreen in interface IColorConstant
      Returns:
      the green component of the color
    • getBlue

      public int getBlue()
      Description copied from interface: IColorConstant
      Returns the amount of blue in the color, from 0 to 255.
      Specified by:
      getBlue in interface IColorConstant
      Returns:
      the blue component of the color