public static class FloatFilters.MultiLerpFilter extends FloatFilter
SColor.lerpFloatColorsBlended(float, float, float)
to mix a requested color with the
chosen target color, and this means the alpha of the target color affects the amount of change instead of the
resulting alpha. Changing the alpha of the colors this is given can be done easily with
SColor.translucentColor(float, float)
, and this allows you to specify varying amounts to mix by.Constructor and Description |
---|
MultiLerpFilter(float amount,
com.badlogic.gdx.graphics.Color[] targets)
Builds a MultiLerpFilter with an array of Color objects (which will be converted to an array of packed float
colors) and an amount as a float.
|
MultiLerpFilter(float amount,
float... targets)
Builds a MultiLerpFilter with an array of packed float colors and an amount as a float.
|
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.
|
alter
public MultiLerpFilter(float amount, com.badlogic.gdx.graphics.Color[] targets)
SColor.translucentColor(Color, float)
to make a float array to pass to
MultiLerpFilter(float, float...)
.amount
- a float that determines how much target will affect an input color; will be clamped between 0f and 1ftargets
- an array of libGDX Color objects; must not be null or emptypublic MultiLerpFilter(float amount, float... targets)
amount
- a float that determines how much target will affect an input color; will be clamped between 0f and 1ftargets
- an array or vararg of packed float colors; must not be null or emptypublic float alter(float color)
alter
in class FloatFilter
color
- a packed float color, as produced by Color.toFloatBits()
Color.toFloatBits()
Copyright © Eben Howard 2012–2022. All rights reserved.