Class Color

java.lang.Object
com.myscript.iink.graphics.Color

public class Color extends Object
Red green blue alpha color representation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Color
     
    static final Color
     
    final int
     
    static final Color
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Color(int rgba)
    Constructor.
    Color(int r, int g, int b, float a)
    Constructor.
    Color(int r, int g, int b, int a)
    Constructor.
    Color(@NotNull Color other)
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    a()
    Returns the alpha channel value.
    final float
    a_f()
    Returns the normalised aslpha channel value.
    final int
    b()
    Returns the blue channel value.
    final float
    b_f()
    Returns the normalised blue channel value.
    boolean
    equals(@Nullable Object obj)
     
    final int
    g()
    Returns the green channel value.
    final float
    g_f()
    Returns the normalised green channel value.
    final int
     
    final int
    r()
    Returns the red channel value.
    final float
    r_f()
    Returns the normalised red channel value.
    final @NotNull String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • rgba

      public final int rgba
    • NONE

      public static final Color NONE
    • BLACK

      public static final Color BLACK
    • WHITE

      public static final Color WHITE
  • Constructor Details

    • Color

      public Color(@NotNull @NotNull Color other)
      Copy constructor.
      Parameters:
      other - copied object.
    • Color

      public Color(int rgba)
      Constructor.
      Parameters:
      rgba - the color value packed as 32bit.
    • Color

      public Color(int r, int g, int b, int a)
      Constructor.
      Parameters:
      r - the red channel value (= 0..255).
      g - the green channel value (= 0..255).
      b - the blue channel value (= 0..255).
      a - the alpha channel value (= 0..255).
    • Color

      public Color(int r, int g, int b, float a)
      Constructor.
      Parameters:
      r - the red channel value (= 0..255).
      g - the green channel value (= 0..255).
      b - the blue channel value (= 0..255).
      a - the alpha channel value (= 0..1).
  • Method Details

    • r

      public final int r()
      Returns the red channel value.
      Returns:
      the red channel value.
    • g

      public final int g()
      Returns the green channel value.
      Returns:
      the green channel value.
    • b

      public final int b()
      Returns the blue channel value.
      Returns:
      the blue channel value.
    • a

      public final int a()
      Returns the alpha channel value.
      Returns:
      the alpha channel value.
    • r_f

      public final float r_f()
      Returns the normalised red channel value.
      Returns:
      the ref channel value.
    • g_f

      public final float g_f()
      Returns the normalised green channel value.
      Returns:
      the green channel value.
    • b_f

      public final float b_f()
      Returns the normalised blue channel value.
      Returns:
      the blue channel value.
    • a_f

      public final float a_f()
      Returns the normalised aslpha channel value.
      Returns:
      the alpha channel value.
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NotNull public final @NotNull String toString()
      Overrides:
      toString in class Object