public class ColorFilter extends Filter
A ColorFilter is a Filter that blends the RGB value of each pixel in the original image with that of a single Color that it uses. The alpha value of the ColorFilter's Color is proportional to the strength of its influence on the filtered image's RGB values. An alpha value of 0 has no effect, and an alpha value of 255 completely replaces the original image's RGB values, thus turning the filtered image into a colored silhouette. The alpha values of the original image's pixels are left unchanged in the filtered image.
Constructor and Description |
---|
ColorFilter(org.newdawn.slick.Color color)
Creates a new ColorFilter that uses the specified Color.
|
ColorFilter(int colorR,
int colorG,
int colorB)
Creates a new ColorFilter that uses a Color with the specified RGB value
and an alpha value of 255.
|
ColorFilter(int colorR,
int colorG,
int colorB,
int colorA)
Creates a new ColorFilter that uses a Color with the specified RGBA
value.
|
Modifier and Type | Method and Description |
---|---|
org.newdawn.slick.Color |
getColor()
Returns the Color that this ColorFilter uses.
|
public ColorFilter(org.newdawn.slick.Color color)
color
- The used Colorpublic ColorFilter(int colorR, int colorG, int colorB, int colorA)
colorR
- The R value (0-255) of the used ColorcolorG
- The G value (0-255) of the used ColorcolorB
- The B value (0-255) of the used ColorcolorA
- The alpha value (0-255) of the used Colorpublic ColorFilter(int colorR, int colorG, int colorB)
colorR
- The R value (0-255) of the used ColorcolorG
- The G value (0-255) of the used ColorcolorB
- The B value (0-255) of the used Color