Class Filters.SaturationValueFilter

java.lang.Object
squidpony.squidgrid.gui.gdx.Filters.SaturationValueFilter
All Implemented Interfaces:
IFilter<com.badlogic.gdx.graphics.Color>
Enclosing class:
Filters

public static class Filters.SaturationValueFilter
extends Object
implements IFilter<com.badlogic.gdx.graphics.Color>
An IFilter that multiplies the saturation and the value of any color requested from it by different numbers given during construction.
  • Field Details

  • Constructor Details

    • SaturationValueFilter

      public SaturationValueFilter​(float saturation, float value)
      Sets up a SaturationValueFilter with the desired saturation and value multipliers. Using a multiplier of 0f for saturation, as you would expect, makes the image grayscale. Using a multiplier of 0f for value makes all colors identicaly black; this is probably not a good idea. Using a multiplier of 0.5 for saturation will make the image "muted", with no truly bright colors, while 1.0f for saturation makes no change, and and any numbers higher than 1.0f for saturation will make the image more saturated, with the exception of colors that were already grayscale or close to it. Using 0.5f for value will darken the image significantly, 1.0f for value will keep it the same for brightness, and higher than 1.0f will lighten it. This clamps the result, so there's no need to worry about using too high of a saturation or value multiplier.
      Parameters:
      saturation - the amount to multiply each requested color's saturation by; 1.0f means "no change"
      value - the amount to multiply each requested color's value (lightness) by; 1.0f means "no change"
  • Method Details

    • alter

      public com.badlogic.gdx.graphics.Color alter​(float r, float g, float b, float a)
      Specified by:
      alter in interface IFilter<com.badlogic.gdx.graphics.Color>