public static class FloatFilters.PaletteReducerFilter extends FloatFilter
PaletteReducer,
and won't return any colors that are missing from that palette (although it can always return fully-transparent).
This is like FloatFilters.PaletteFilter but trades off memory usage (it uses about 33KB to store a large-ish lookup
table) to improve speed on large palettes. This can't use a palette larger than 256 colors (including transparent
almost always).| Modifier and Type | Field and Description |
|---|---|
com.github.tommyettinger.anim8.PaletteReducer |
reducer |
| Constructor and Description |
|---|
PaletteReducerFilter()
Builds a PaletteReducerFilter that will use the 256-color (including transparent) DawnBringer Aurora palette.
|
PaletteReducerFilter(com.badlogic.gdx.graphics.Color... targets)
Builds a PaletteReducerFilter with an array or vararg of libGDX colors (at most 256 colors, and often
starting with a transparent color) that this will choose from.
|
PaletteReducerFilter(com.github.tommyettinger.anim8.PaletteReducer palette)
Builds a PaletteReducerFilter with the given PaletteReducer, which will be referenced without copying.
|
| Modifier and Type | Method and Description |
|---|---|
float |
alter(float color)
Takes a packed float color and produces a potentially-different packed float color that this FloatFilter edited.
|
alterpublic PaletteReducerFilter()
public PaletteReducerFilter(com.github.tommyettinger.anim8.PaletteReducer palette)
PaletteReducer.exact(Color[]) or other similar methods before this filter is used to set up
the palette, and this is often done before the PaletteReducer is passed here.palette - a PaletteReducer that should have the desired palette set up before this is usedpublic PaletteReducerFilter(com.badlogic.gdx.graphics.Color... targets)
targets - an array or vararg of libGDX colors; must not be nullpublic float alter(float color)
alter in class FloatFiltercolor - a packed float color, as produced by Color.toFloatBits()Color.toFloatBits()Copyright © Eben Howard 2012–2022. All rights reserved.