java.lang.Object
io.github.cottonmc.cotton.gui.widget.data.Color.RGB
All Implemented Interfaces:
Color
Enclosing interface:
Color

public static class Color.RGB extends Object implements Color
  • Constructor Details

    • RGB

      public RGB(int value)
    • RGB

      public RGB(int a, int r, int g, int b)
    • RGB

      public RGB(int r, int g, int b)
      Constructs an RGB object with 100% alpha value (no transparency)
      Since:
      2.0.0
  • Method Details

    • toRgb

      public int toRgb()
      Description copied from interface: Color
      Gets an ARGB integer representing this color in the sRGB colorspace.
      Specified by:
      toRgb in interface Color
    • getA

      public int getA()
    • getR

      public int getR()
    • getG

      public int getG()
    • getB

      public int getB()
    • getChroma

      public int getChroma()
      Gets the chroma value, which is related to the length of the vector in projected (hexagonal) space.
    • getHue

      public int getHue()
      Gets the HSV/HSL Hue, which is the angle around the color hexagon (or circle)
    • getLightness

      public int getLightness()
      Gets the HSL Lightness, or average light intensity, of this color
    • getLuma

      public int getLuma()
      Gets the HSL Luma, or perceptual brightness, of this color
    • getValue

      public int getValue()
      Gets the HSV Value, which is just the largest component in the color
    • getHSVSaturation

      public float getHSVSaturation()
      Gets the saturation for this color based on chrominance and HSV Value
    • getHSLSaturation

      public float getHSLSaturation()
      Gets the saturation for this color based on chrominance and HSL luma.
    • interpolate

      public Color.RGB interpolate(Color.RGB endColor, double t)
      Calculates an interpolated value along the fraction t between 0.0 and 1.0. When t = 1.0, endVal is returned. Eg.: If this color is black, your endColor is white and t = 0.5 you get gray.
      Parameters:
      endColor - a Color to interpolate with
      t - fraction between 0.0 and 1.0
      Since:
      2.3.0