Class RgbaQuadruplet
java.lang.Object
de.xima.fc.color.RgbaQuadruplet
- All Implemented Interfaces:
IOpaqueRgbHexColorProviding, Serializable
Represents an RGBA (red, green, blue, alpha) quadruplet.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanintdoubleintdoubleintdoublegetHex()intGets the opaque color as a hex RGB value, e.g. 0x#FF0000 for red.intdoublelonggetRgba()inthashCode()static RgbaQuadrupletof(double[] components) static RgbaQuadrupletof(double red, double green, double blue, double alpha) static RgbaQuadrupletof(int red, int green, int blue, int alpha) static RgbaQuadrupletof(long rgba) static RgbaQuadrupletstatic RgbaQuadrupletof(String hexString, RgbaQuadruplet defaultValue) scaled(double scaleRed, double scaleGreen, double scaleBlue, double alphaScale) Converts this rgba quadruplet to a CSS color.Converts this rgba quadruplet to a RGB triplet.toString()withAlpha(double newAlpha) withAlpha(int newAlpha)
-
Method Details
-
equals
-
getAlphaInt
public int getAlphaInt() -
getAlphaNorm
public double getAlphaNorm() -
getBlueInt
public int getBlueInt() -
getBlueNorm
public double getBlueNorm() -
getGreenInt
public int getGreenInt() -
getGreenNorm
public double getGreenNorm() -
getHex
-
getOpaqueRgbHexColor
public int getOpaqueRgbHexColor()Description copied from interface:IOpaqueRgbHexColorProvidingGets the opaque color as a hex RGB value, e.g. 0x#FF0000 for red.- Specified by:
getOpaqueRgbHexColorin interfaceIOpaqueRgbHexColorProviding- Returns:
- The hex RGB value of the color.
-
getRedInt
public int getRedInt() -
getRedNorm
public double getRedNorm() -
getRgba
public long getRgba() -
hashCode
-
scaled
public RgbaQuadruplet scaled(double scaleRed, double scaleGreen, double scaleBlue, double alphaScale) - Parameters:
scaleRed- Scale for the red value.scaleGreen- Scale for the green value.scaleBlue- Scale for the blue value.alphaScale- Scale for the alpha value.- Returns:
- Scales all components by the given factors.
-
toCssColor
-
toRgbTriple
Converts this rgba quadruplet to a RGB triplet. Sets the alpha value to 1 (fully opaque).- Returns:
- The RGB triplet.
-
toString
-
withAlpha
-
withAlpha
-
of
-
of
-
of
-
of
-
of
-
of
-