public final class UtilColor extends Object
Modifier and Type | Method and Description |
---|---|
static int |
filterRgb(int rgb,
int fr,
int fg,
int fb)
Apply a filter rgb.
|
static double |
getDelta(ColorRgba a,
ColorRgba b)
Return the delta between two colors.
|
static int |
getRasterColor(int i,
RasterData data,
int max)
Get raster color.
|
static ColorRgba |
getWeightedColor(ImageBuffer surface,
int sx,
int sy,
int width,
int height)
Get the weighted color of an area.
|
static int |
inc(int value,
int r,
int g,
int b)
Get the increased color value.
|
static boolean |
isOpaqueTransparentExclusive(ColorRgba colorA,
ColorRgba colorB)
Check if colors transparency type are exclusive (one is
ColorRgba.OPAQUE and the other
ColorRgba.TRANSPARENT ). |
static boolean |
isOpaqueTransparentExclusive(int colorA,
int colorB)
Check if colors transparency type are exclusive (one is
ColorRgba.OPAQUE and the other
ColorRgba.TRANSPARENT ). |
public static int filterRgb(int rgb, int fr, int fg, int fb)
rgb
- The original rgb.fr
- The red filter.fg
- The green filter.fb
- The blue filter.public static int inc(int value, int r, int g, int b)
value
- The original color value.r
- The increase red value.g
- The increase green value.b
- The increase blue value.public static double getDelta(ColorRgba a, ColorRgba b)
a
- The first color.b
- The second color.public static int getRasterColor(int i, RasterData data, int max)
i
- The color offset.data
- The raster data.max
- The max offset.public static ColorRgba getWeightedColor(ImageBuffer surface, int sx, int sy, int width, int height)
surface
- The surface reference.sx
- The starting horizontal location.sy
- The starting vertical location.width
- The area width.height
- The area height.public static boolean isOpaqueTransparentExclusive(ColorRgba colorA, ColorRgba colorB)
ColorRgba.OPAQUE
and the other
ColorRgba.TRANSPARENT
).colorA
- The first color.colorB
- The second color.true
if exclusive, false
else.public static boolean isOpaqueTransparentExclusive(int colorA, int colorB)
ColorRgba.OPAQUE
and the other
ColorRgba.TRANSPARENT
).colorA
- The first color.colorB
- The second color.true
if exclusive, false
else.Copyright © 2017 Byron 3D Games Studio. All rights reserved.