Class FloatFilters.GrayscaleFilter

java.lang.Object
squidpony.squidgrid.gui.gdx.FloatFilter
squidpony.squidgrid.gui.gdx.FloatFilters.GrayscaleFilter
Enclosing class:
FloatFilters

public static class FloatFilters.GrayscaleFilter
extends FloatFilter
A FloatFilter that makes all colors given to it grayscale, using only their luma as calculated by SColor.lumaOfFloat(float) as the lightness (it does also preserve alpha transparency).
  • Constructor Details

  • Method Details

    • alter

      public float alter​(float color)
      Takes a packed float color and produces a grayscale packed float color that this FloatFilter edited. Uses the luma calculation from SColor.lumaOfFloat(float) instead of the value calculation from SColor.valueOfFloat(float); luma tends to be more visually-accurate on modern monitors.
      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()