Package squidpony.squidgrid.gui.gdx
Class FloatFilters
java.lang.Object
squidpony.squidgrid.gui.gdx.FloatFilters
public final class FloatFilters extends Object
Pre-made FloatFilter classes that you can use to filter colors without producing extra Color objects.
Created by Tommy Ettinger on 7/22/2018.
Created by Tommy Ettinger on 7/22/2018.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FloatFilters.ChainFilter
A FloatFilter that chains together one or more FloatFilters one after the next, passing the float output of one as input to the next until the chain has all been called.static class
FloatFilters.ColorizeFilter
Changes all colors this alters to have the same hue as, and a closer saturation to, a target color given in the constructor, as well as optionally multiplying saturation of the result and/or adding lightness/value.static class
FloatFilters.DistinctRedGreenFilter
A FloatFilter that alters primarily-red and primarily-green colors so they can be more easily be distinguished by people with at least some forms of red-green color-blindness (deuteranopia should be handled well, protanopia very well, and tritanopia may not benefit at all).static class
FloatFilters.GrayscaleFilter
A FloatFilter that makes all colors given to it grayscale, using only their luma as calculated bySColor.lumaOfFloat(float)
as the lightness (it does also preserve alpha transparency).static class
FloatFilters.HSVFilter
Wraps the functionality ofSColor.toEditedFloat(float, float, float, float, float)
so it can be called as a FloatFilter, adding values to hue, saturation, and value (clamping saturation and value and wrapping hue).static class
FloatFilters.IdentityFilter
A FloatFilter that makes no changes to the colors given to it; useful as a default for when no filter is wanted.static class
FloatFilters.LerpFilter
A FloatFilter that linearly interpolates (lerps) any color it is given toward a specified color by a specified amount.static class
FloatFilters.MultiLerpFilter
A FloatFilter that linearly interpolates (lerps) any color it is given toward the most-similar of a group of given colors.static class
FloatFilters.PaletteFilter
A FloatFilter that limits the colors it can return to a fixed palette, and won't return any colors that are missing from that palette (although it can always return fully-transparent).static class
FloatFilters.PaletteReducerFilter
A FloatFilter that limits the colors it can return to a fixed palette as determined by aPaletteReducer
, and won't return any colors that are missing from that palette (although it can always return fully-transparent).static class
FloatFilters.YCbCrFilter
LikeFloatFilters.HSVFilter
, but edits its input colors in YCbCr color space, and multiplies rather than adds.static class
FloatFilters.YCoCgFilter
LikeFloatFilters.YCbCrFilter
, but edits its input colors in YCoCg color space, or likeFloatFilters.HSVFilter
except it doesn't add, it multiplies.static class
FloatFilters.YCwCmFilter
LikeFloatFilters.YCbCrFilter
orFloatFilters.YCoCgFilter
, but edits its input colors in YCwCm color space, which is very similar to YCoCg but has chroma/chrominance components that are useful aesthetically on their own. -
Field Summary
Fields Modifier and Type Field Description static FloatFilters.GrayscaleFilter
grayscaleFilter
static FloatFilters.IdentityFilter
identityFilter
A static constant of the one possible IdentityFilter, to avoid needing to make duplicates. -
Method Summary
-
Field Details
-
identityFilter
A static constant of the one possible IdentityFilter, to avoid needing to make duplicates. IdentityFilter makes no changes to the colors given to it. -
grayscaleFilter
-