public static class Filters.PaletteFilter
extends java.lang.Object
implements squidpony.IFilter<com.badlogic.gdx.graphics.Color>
SColor.RED_SERIES
or
SColor.ACHROMATIC_SERIES
. This can also be used to enforce usage of a limited color palette such as
one of DawnBringer's popular pixel art palettes, SColor.DAWNBRINGER_16
and
SColor.DAWNBRINGER_32
. Beyond 32 colors, the palettes SColor.VARIED_PALETTE
with 56 colors
and SColor.COLOR_WHEEL_PALETTE
with 198 colors can be used.
Preview using BLUE_GREEN_SERIES foreground, ACHROMATIC_SERIES background: http://i.imgur.com/2HdZpC9.pngModifier and Type | Field and Description |
---|---|
com.badlogic.gdx.graphics.Color[] |
colorStore
The array of Color objects this will use as a palette.
|
Constructor and Description |
---|
PaletteFilter(com.badlogic.gdx.graphics.Color[] colors)
Sets up a PaletteFilter with the exact colors to use as Colors.
|
PaletteFilter(float[] r,
float[] g,
float[] b)
Sets up a PaletteFilter with the exact colors to use as individual components; the lengths of each given
array should be identical.
|
Modifier and Type | Method and Description |
---|---|
com.badlogic.gdx.graphics.Color |
alter(float r,
float g,
float b,
float a) |
public com.badlogic.gdx.graphics.Color[] colorStore
public PaletteFilter(float[] r, float[] g, float[] b)
r
- the red components to useg
- the green components to useb
- the blue components to usepublic PaletteFilter(com.badlogic.gdx.graphics.Color[] colors)
colors
array is used verbatim (as a reference, not a copy), so changes to the Color values inside
it will change how this PaletteFilter works (possibly badly). If you expect to edit the array you give as a
parameter to this, it may be optimal to give a temporary copy.colors
- the Colors to use as an array; will be referenced in the PaletteFilter, so changing items in
this array will change what Colors will be usedCopyright © Eben Howard 2012–2022. All rights reserved.