Package com.sksamuel.scrimage.color
Class RGBColor
- java.lang.Object
-
- com.sksamuel.scrimage.color.RGBColor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
average()
boolean
equals(java.lang.Object o)
static RGBColor
fromARGBInt(int argb)
static RGBColor
fromAwt(java.awt.Color color)
static RGBColor
fromRGB(int[] rgb)
static RGBColor
fromRGBInt(int rgb)
int
hashCode()
int
toARGBInt()
int[]
toArray()
CMYKColor
toCMYK()
Returns a conversion of this color into a CYMK color.HSLColor
toHSL()
HSVColor
toHSV()
int
toInt()
Deprecated.RGBColor
toRGB()
Returns a conversion of this Color into an RGBColor.java.lang.String
toString()
RGBColor
withBlue(int b)
RGBColor
withGreen(int g)
RGBColor
withRed(int r)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.sksamuel.scrimage.color.Color
average, awt, paint, toAWT, toGrayscale, toGrayscale, toHex, toPixel
-
-
-
-
Method Detail
-
fromARGBInt
public static RGBColor fromARGBInt(int argb)
-
fromRGBInt
public static RGBColor fromRGBInt(int rgb)
-
fromAwt
public static RGBColor fromAwt(java.awt.Color color)
-
fromRGB
public static RGBColor fromRGB(int[] rgb)
-
toInt
@Deprecated public int toInt()
Deprecated.Returns as an int the value of this color. The RGB and alpha components are packed as rgba. Use toARGBInt() for clarity.
-
toARGBInt
public int toARGBInt()
-
toRGB
public RGBColor toRGB()
Description copied from interface:Color
Returns a conversion of this Color into an RGBColor. If this colour is already an instance of RGBColor then the same instance will be returned.
-
withRed
public RGBColor withRed(int r)
-
withBlue
public RGBColor withBlue(int b)
-
withGreen
public RGBColor withGreen(int g)
-
average
public int average()
-
toArray
public int[] toArray()
-
toCMYK
public CMYKColor toCMYK()
Returns a conversion of this color into a CYMK color. If this colour is already a CYMK then the same instance will be returned.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-