Class Color

java.lang.Object
com.raylib.Color

public class Color extends Object
Color, 4 components, R8G8B8A8 (32bit)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct with auto memory allocator and fields initialized to zero.
    Color(byte r, byte g, byte b, byte a)
    Construct with auto memory allocator and fields initialized as specified
    Color(MemorySegment memorySegment)
    Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    Construct with your owm memory allocator and fields not initialized
    Color(SegmentAllocator arena, byte r, byte g, byte b, byte a)
    Construct with your own memory allocator and fields initialized as specified
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    a()
    Color alpha value
    a(byte value)
    Color alpha value
    static Color
    allocateArray(long elementCount)
    Allocate an array of Color
    static Color
    allocateArray(long elementCount, SegmentAllocator allocator)
    Allocate an array of Color
    byte
    b()
    Color blue value
    b(byte value)
    Color blue value
    boolean
    Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
    byte
    g()
    Color green value
    g(byte value)
    Color green value
    byte
    Color alpha value
    getArrayElement(int index)
     
    byte
    Color blue value
    byte
    Color green value
    byte
    Color red value
    int
     
    byte
    r()
    Color red value
    r(byte value)
    Color red value
    void
    setA(byte value)
    Color alpha value
    void
    setB(byte value)
    Color blue value
    void
    setG(byte value)
    Color green value
    void
    setR(byte value)
    Color red value

    Methods inherited from class java.lang.Object

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

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Color

      public Color()
      Construct with auto memory allocator and fields initialized to zero.
    • Color

      public Color(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Color

      public Color(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Color

      public Color(byte r, byte g, byte b, byte a)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      r - Color red value
      g - Color green value
      b - Color blue value
      a - Color alpha value
    • Color

      public Color(SegmentAllocator arena, byte r, byte g, byte b, byte a)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      r - Color red value
      g - Color green value
      b - Color blue value
      a - Color alpha value
  • Method Details

    • equals

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getArrayElement

      public Color getArrayElement(int index)
    • allocateArray

      public static Color allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Color
    • allocateArray

      public static Color allocateArray(long elementCount)
      Allocate an array of Color
    • getR

      public byte getR()
      Color red value
    • setR

      public void setR(byte value)
      Color red value
    • r

      public byte r()
      Color red value
    • r

      public Color r(byte value)
      Color red value
    • getG

      public byte getG()
      Color green value
    • setG

      public void setG(byte value)
      Color green value
    • g

      public byte g()
      Color green value
    • g

      public Color g(byte value)
      Color green value
    • getB

      public byte getB()
      Color blue value
    • setB

      public void setB(byte value)
      Color blue value
    • b

      public byte b()
      Color blue value
    • b

      public Color b(byte value)
      Color blue value
    • getA

      public byte getA()
      Color alpha value
    • setA

      public void setA(byte value)
      Color alpha value
    • a

      public byte a()
      Color alpha value
    • a

      public Color a(byte value)
      Color alpha value