Class Color.RGB
java.lang.Object
io.github.cottonmc.cotton.gui.widget.data.Color.RGB
- All Implemented Interfaces:
Color
- Enclosing interface:
Color
-
Nested Class Summary
-
Field Summary
Fields inherited from interface io.github.cottonmc.cotton.gui.widget.data.Color
BLACK, BLACK_DYE, BLUE, BLUE_DYE, BROWN_DYE, CYAN_DYE, DYE_COLORS, GRAY_DYE, GREEN, GREEN_DYE, LIGHT_BLUE_DYE, LIGHT_GRAY_DYE, LIME_DYE, MAGENTA_DYE, ORANGE_DYE, PINK_DYE, PURPLE_DYE, RED, RED_DYE, WHITE, WHITE_DYE, YELLOW_DYE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetA()intgetB()intGets the chroma value, which is related to the length of the vector in projected (hexagonal) space.intgetG()floatGets the saturation for this color based on chrominance and HSL luma.floatGets the saturation for this color based on chrominance and HSV ValueintgetHue()Gets the HSV/HSL Hue, which is the angle around the color hexagon (or circle)intGets the HSL Lightness, or average light intensity, of this colorintgetLuma()Gets the HSL Luma, or perceptual brightness, of this colorintgetR()intgetValue()Gets the HSV Value, which is just the largest component in the colorinterpolate(Color.RGB endColor, double t) Calculates an interpolated value along the fraction t between 0.0 and 1.0.inttoRgb()Gets an ARGB integer representing this color in the sRGB colorspace.
-
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:ColorGets an ARGB integer representing this color in the sRGB colorspace. -
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
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 witht- fraction between 0.0 and 1.0- Since:
- 2.3.0
-