Package squidpony.squidgrid.gui.gdx
Class Filters.SaturationFilter
java.lang.Object
squidpony.squidgrid.gui.gdx.Filters.SaturationFilter
- All Implemented Interfaces:
IFilter<com.badlogic.gdx.graphics.Color>
- Enclosing class:
- Filters
public static class Filters.SaturationFilter extends Object implements IFilter<com.badlogic.gdx.graphics.Color>
An IFilter that multiplies the saturation of any color requested from it by a number given during construction.
When desaturating, you may want to prefer
Filters.SaturationValueFilter
, because reducing saturation increases
perceived brightness (value), and desaturating an ocean-blue color will make it look like ice if the value
isn't decreased as well. This class is perfectly fine for increasing saturation, in general.-
Field Summary
Fields Modifier and Type Field Description float
multiplier
-
Constructor Summary
Constructors Constructor Description SaturationFilter(float multiplier)
Sets up a SaturationFilter with the desired saturation multiplier. -
Method Summary
Modifier and Type Method Description com.badlogic.gdx.graphics.Color
alter(float r, float g, float b, float a)
-
Field Details
-
Constructor Details
-
SaturationFilter
Sets up a SaturationFilter with the desired saturation multiplier. Using a multiplier of 0f, as you would expect, makes the image grayscale. Using a multiplier of 0.5 make the image "muted", with no truly bright colors, while 1.0f makes no change, and and any numbers higher than 1.0f will make the image more saturated, with the exception of colors that were already grayscale or close to it. This clamps the result, so there's no need to worry about using too high of a saturation multiplier.- Parameters:
multiplier
- the amount to multiply each requested color's saturation by; 1.0f means "no change"
-
-
Method Details