Package com.sksamuel.scrimage.color
Interface Color
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RGBColor
average(Color other)
Returns the average of this Color merged with another Color.default java.awt.Color
awt()
default java.awt.Paint
paint()
Returns this colour as an AWT Paint.default java.awt.Color
toAWT()
Returns this instance as a java.awt.Color.default CMYKColor
toCMYK()
Returns a conversion of this color into a CYMK color.default Grayscale
toGrayscale()
default Grayscale
toGrayscale(GrayscaleMethod method)
default java.lang.String
toHex()
Returns a HEX String of this colour.default HSLColor
toHSL()
default HSVColor
toHSV()
default Pixel
toPixel(int x, int y)
RGBColor
toRGB()
Returns a conversion of this Color into an RGBColor.
-
-
-
Method Detail
-
toRGB
RGBColor toRGB()
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.
-
toCMYK
default 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.
-
toHSV
default HSVColor toHSV()
-
toHSL
default HSLColor toHSL()
-
toGrayscale
default Grayscale toGrayscale()
-
toGrayscale
default Grayscale toGrayscale(GrayscaleMethod method)
-
toHex
default java.lang.String toHex()
Returns a HEX String of this colour. Eg for 0,255,0, this method will return 00FF00.
-
awt
default java.awt.Color awt()
-
toAWT
default java.awt.Color toAWT()
Returns this instance as a java.awt.Color. AWT Colors use the RGB color model.
-
toPixel
default Pixel toPixel(int x, int y)
-
average
default RGBColor average(Color other)
Returns the average of this Color merged with another Color. Takes into account alpha and returns the average as an RGB value.See https://stackoverflow.com/questions/1944095/how-to-mix-two-argb-pixels
-
paint
default java.awt.Paint paint()
Returns this colour as an AWT Paint.
-
-