Package com.helger.css.decl
Class CSSRGB
- java.lang.Object
-
- com.helger.css.decl.CSSRGB
-
- All Implemented Interfaces:
com.helger.commons.lang.ICloneable<CSSRGB>,ICSSColor,ICSSWriteable
@NotThreadSafe public class CSSRGB extends Object implements ICSSWriteable, ICSSColor, com.helger.commons.lang.ICloneable<CSSRGB>
Represents a single RGB color value (red, green, blue)- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetAsCSSString(ICSSWriterSettings aSettings, int nIndentLevel)Get the contents of this object as a serialized CSS string for writing to an output.CSSRGBAgetAsRGBA(float fOpacity)Convert this value to an RGBA value.CSSRGBAgetAsRGBA(String sOpacity)Convert this value to an RGBA value.StringgetAsString()StringgetBlue()CSSRGBgetClone()StringgetGreen()StringgetRed()inthashCode()CSSRGBsetBlue(String sBlue)CSSRGBsetGreen(String sGreen)CSSRGBsetRed(String sRed)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.css.ICSSWriteable
getAsCSSString, getAsCSSString
-
-
-
-
Constructor Detail
-
CSSRGB
public CSSRGB(@Nonnull CSSRGB aOther)
Copy constructor- Parameters:
aOther- The object to copy the data from. May not benull.
-
CSSRGB
public CSSRGB(int nRed, int nGreen, int nBlue)Constructor- Parameters:
nRed- Red part. Is fitted to a value between 0 and 255.nGreen- Green part. Is fitted to a value between 0 and 255.nBlue- Blue part. Is fitted to a value between 0 and 255.
-
-
Method Detail
-
getAsRGBA
@Nonnull public CSSRGBA getAsRGBA(float fOpacity)
Convert this value to an RGBA value.- Parameters:
fOpacity- Opacity part. Is fitted to a value between 0 and 1.- Returns:
- This value as RGBA value with the passed opacity. Never
null. - Since:
- 3.8.3
-
getAsRGBA
@Nonnull public CSSRGBA getAsRGBA(@Nonnull @Nonempty String sOpacity)
Convert this value to an RGBA value.- Parameters:
sOpacity- Opacity part. May neither benullnor empty.- Returns:
- This value as RGBA value with the passed opacity. Never
null. - Since:
- 3.8.3
-
getAsString
@Nonnull @Nonempty public String getAsString()
- Specified by:
getAsStringin interfaceICSSColor- Returns:
- The textual representation of the color.
- Since:
- 3.8.3
-
getAsCSSString
@Nonnull @Nonempty public String getAsCSSString(@Nonnull ICSSWriterSettings aSettings, @Nonnegative int nIndentLevel)
Description copied from interface:ICSSWriteableGet the contents of this object as a serialized CSS string for writing to an output.- Specified by:
getAsCSSStringin interfaceICSSWriteable- Parameters:
aSettings- The settings to be used to format the output. May not benull.nIndentLevel- The current indentation level- Returns:
- The content of this object as CSS string. Never
null.
-
getClone
@Nonnull public CSSRGB getClone()
- Specified by:
getClonein interfacecom.helger.commons.lang.ICloneable<CSSRGB>- Since:
- 3.8.3
-
-