Record Class ColorUtil.Gamut

java.lang.Object
java.lang.Record
org.openhab.core.util.ColorUtil.Gamut
Record Components:
r - double array with xy coordinates for red, x, y between 0.0000 and 1.0000.
g - double array with xy coordinates for green, x, y between 0.0000 and 1.0000.
b - double array with xy coordinates for blue, x, y between 0.0000 and 1.0000.
Enclosing class:
ColorUtil

public static record ColorUtil.Gamut(double[] r, double[] g, double[] b) extends Record
Color gamut
  • Constructor Summary

    Constructors
    Constructor
    Description
    Gamut(double[] r, double[] g, double[] b)
    Creates an instance of a Gamut record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    b()
    Returns the value of the b record component.
    return point in color gamut closest to a given point
    final boolean
    Indicates whether some other object is "equal to" this one.
    double[]
    g()
    Returns the value of the g record component.
    final int
    Returns a hash code value for this object.
    double[]
    r()
    Returns the value of the r record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Gamut

      public Gamut(double[] r, double[] g, double[] b)
      Creates an instance of a Gamut record class.
      Parameters:
      r - the value for the r record component
      g - the value for the g record component
      b - the value for the b record component
  • Method Details

    • closest

      public ColorUtil.Point closest(ColorUtil.Point p)
      return point in color gamut closest to a given point
      Parameters:
      p - a color point
      Returns:
      the color point closest to in this gamut
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • r

      public double[] r()
      Returns the value of the r record component.
      Returns:
      the value of the r record component
    • g

      public double[] g()
      Returns the value of the g record component.
      Returns:
      the value of the g record component
    • b

      public double[] b()
      Returns the value of the b record component.
      Returns:
      the value of the b record component