Module omix.api
Package omix.lang

Class Color

java.lang.Object
omix.lang.Color
All Implemented Interfaces:
Serializable, Brush, Paint

public final class Color
extends Object
implements Brush, Serializable
This class represents color in Omix diagrams.

Color

Author:
Dr. Peter Droste, Omix Visualization
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    Color​(int color)
    Creates a color with the given RGBA value.
    Color​(int red, int green, int blue)
    Creates a color with the submitted red, green and blue values between 0 and 255.
    Color​(int red, int green, int blue, int alpha)
    Creates a color with the given red, green, blue and alpha values between 0 and 255.
    Color​(String c)
    Creates a new color from the given string.
    Color​(Color color)
    clones the submitted color.
  • Method Summary

    Modifier and Type Method Description
    Color clone()  
    boolean equals​(Object obj)  
    int getAlpha()
    Returns the alpha component in the range 0-255.
    int getBlue()
    Returns the blue component in the range 0-255.
    int getGreen()
    Returns the green component in the range 0-255.
    int getRed()
    Returns the red component in the range 0-255.
    int getRgba()
    Returns the RGBA value representing the color.
    int hashCode()  
    int rgba()  
    String toHexString()
    This method returns the rgba value as hexadecimal string.
    String toString()
    Returns the rgba value as text.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Color

      public Color​(String c)
      Creates a new color from the given string. This can be a hexadecimal number starting with "#" or "0x" or one of:
      • "black"
      • "blue"
      • "cyan"
      • "darkGray"
      • "gray"
      • "green"
      • "lightGray"
      • "magenta"
      • "orange"
      • "pink"
      • "red"
      • "white"
      • "yellow"
      Parameters:
      c - Color as text.
    • Color

      @ConstructorProperties("color") public Color​(Color color)
      clones the submitted color.
      Parameters:
      color - Color to be cloned
    • Color

      @ConstructorProperties({"red","green","blue","alpha"}) public Color​(int red, int green, int blue, int alpha)
      Creates a color with the given red, green, blue and alpha values between 0 and 255.
      Parameters:
      red - Red
      green - Green
      blue - Blue
      alpha - Alpha
    • Color

      @ConstructorProperties({"red","green","blue"}) public Color​(int red, int green, int blue)
      Creates a color with the submitted red, green and blue values between 0 and 255.
      Parameters:
      red - Red
      green - Green
      blue - Blue
    • Color

      @ConstructorProperties("color") public Color​(int color)
      Creates a color with the given RGBA value.
      Parameters:
      color - RGBA value
  • Method Details