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 Details

    • 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

      public float alter​(float color)
      Takes a packed float color and produces a potentially-different packed float color that this FloatFilter edited.
      Specified by:
      alter in class FloatFilter
      Parameters:
      color - a packed float color, as produced by Color.toFloatBits()
      Returns:
      a packed float color, as produced by Color.toFloatBits()