Package squidpony.squidgrid.gui.gdx
Class FloatFilters.DistinctRedGreenFilter
java.lang.Object
squidpony.squidgrid.gui.gdx.FloatFilter
squidpony.squidgrid.gui.gdx.FloatFilters.DistinctRedGreenFilter
- Enclosing class:
- FloatFilters
public static class FloatFilters.DistinctRedGreenFilter extends FloatFilter
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). Causes reds to be darkened and greens to be lightened if the
other of the pair is not present in similar quantities (which is the case for yellows and blues).
-
Constructor Summary
Constructors Constructor Description DistinctRedGreenFilter()
Constructs a DistinctRedGreenFilter. -
Method Summary
Modifier and Type Method Description float
alter(float color)
Takes a packed float color and produces a potentially-different packed float color that this FloatFilter edited.
-
Constructor Details
-
DistinctRedGreenFilter
public DistinctRedGreenFilter()Constructs a DistinctRedGreenFilter. This class is a simple wrapper around a function that doesn't need member variables, so there should be little overhead with this filter.
-
-
Method Details
-
alter
Takes a packed float color and produces a potentially-different packed float color that this FloatFilter edited.- Specified by:
alter
in classFloatFilter
- Parameters:
color
- a packed float color, as produced byColor.toFloatBits()
- Returns:
- a packed float color, as produced by
Color.toFloatBits()
-