Class HSVColor
java.lang.Object
org.strassburger.colorlab4j.color.Color
org.strassburger.colorlab4j.color.spaces.HSVColor
Represents a color in the HSV color space
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HSVColorGet the HSV representation of a color from a hex stringdoublegetHue()Get the hue value of the color (Degrees, 0-360)doubleGet the saturation value of the color (Fraction, 0.0-1.0)doublegetValue()Get the value value (bruh) of the color (Fraction, 0.0-1.0)Get the CSS representation of the colortoHSL()Convert the color to HSLtoHSV()Convert the color to HSVtoLAB()Convert the color to LABtoRGB()Convert the color to RGBtoString()toXYZ()Convert the color to XYZMethods inherited from class org.strassburger.colorlab4j.color.Color
toAnsi, toAnsiBackground, toHex
-
Constructor Details
-
HSVColor
- Parameters:
h- Hue value (Degrees, 0-360)s- Saturation value (Fraction, 0.0-1.0)v- Value value (Fraction, 0.0-1.0)- Throws:
IllegalArgumentException- If any of the values are out of range
-
-
Method Details
-
getHue
public double getHue()Get the hue value of the color (Degrees, 0-360)- Returns:
- Hue value
-
getSaturation
public double getSaturation()Get the saturation value of the color (Fraction, 0.0-1.0)- Returns:
- Saturation value
-
getValue
public double getValue()Get the value value (bruh) of the color (Fraction, 0.0-1.0)- Returns:
- Value value
-
toRGB
Description copied from class:ColorConvert the color to RGB -
toHSL
Description copied from class:ColorConvert the color to HSL -
toHSV
Description copied from class:ColorConvert the color to HSV -
toLAB
Description copied from class:ColorConvert the color to LAB -
toXYZ
Description copied from class:ColorConvert the color to XYZ -
toCssString
Description copied from class:ColorGet the CSS representation of the color- Specified by:
toCssStringin classColor- Returns:
- CSS representation of the color
-
toString
-
fromHex
Get the HSV representation of a color from a hex string- Parameters:
hex- Hex representation of the color (e.g. "#ff0000")- Returns:
- HSV representation of the color
- Throws:
IllegalArgumentException- If the HEX code is invalid
-