Package de.xima.fc.color
Class RgbaQuadruplet
- java.lang.Object
-
- de.xima.fc.color.RgbaQuadruplet
-
- All Implemented Interfaces:
Serializable
public class RgbaQuadruplet extends Object implements Serializable
Represents an RGBA (red, green, blue, alpha) quadruplet.- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getAlphaInt()
double
getAlphaNorm()
int
getBlueInt()
double
getBlueNorm()
int
getGreenInt()
double
getGreenNorm()
String
getHex()
int
getRedInt()
double
getRedNorm()
long
getRgba()
int
hashCode()
static RgbaQuadruplet
of(double[] components)
static RgbaQuadruplet
of(double red, double green, double blue, double alpha)
static RgbaQuadruplet
of(int red, int green, int blue, int alpha)
static RgbaQuadruplet
of(long rgba)
static RgbaQuadruplet
of(String hexString)
static RgbaQuadruplet
of(String hexString, RgbaQuadruplet defaultValue)
RgbaQuadruplet
scaled(double scaleRed, double scaleGreen, double scaleBlue, double alphaScale)
CssColor
toCssColor()
Converts this rgba quadruplet to a CSS color.RgbTriplet
toRgbTriple()
Converts this rgba quadruplet to a RGB triplet.String
toString()
-
-
-
Method Detail
-
getRedInt
public int getRedInt()
-
getRedNorm
public double getRedNorm()
-
getGreenInt
public int getGreenInt()
-
getGreenNorm
public double getGreenNorm()
-
getBlueInt
public int getBlueInt()
-
getBlueNorm
public double getBlueNorm()
-
getAlphaInt
public int getAlphaInt()
-
getAlphaNorm
public double getAlphaNorm()
-
getHex
public String getHex()
-
getRgba
public long getRgba()
-
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
public CssColor toCssColor()
Converts this rgba quadruplet to a CSS color.- Returns:
- The CSS color.
-
toRgbTriple
public RgbTriplet toRgbTriple()
Converts this rgba quadruplet to a RGB triplet. Sets the alpha value to 1 (fully opaque).- Returns:
- The RGB triplet.
-
of
public static RgbaQuadruplet of(double red, double green, double blue, double alpha)
-
of
public static RgbaQuadruplet of(double[] components)
-
of
public static RgbaQuadruplet of(long rgba)
-
of
public static RgbaQuadruplet of(int red, int green, int blue, int alpha)
-
of
public static RgbaQuadruplet of(String hexString)
-
of
public static RgbaQuadruplet of(String hexString, RgbaQuadruplet defaultValue)
-
-