Class Filters.ColorizeFilter

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

public static class Filters.ColorizeFilter
extends Object
implements IFilter<com.badlogic.gdx.graphics.Color>
An IFilter that is constructed with a color and makes any color it is told to alter have the same hue as the given color, have saturation that is somewhere between the given color's and the altered colors, and chiefly is distinguishable from other colors by value. Useful for sepia effects, which can be created satisfactorily with new Filters.ColorizeFilter(SColor.CLOVE_BROWN, 0.6f, 0.0f).
  • Field Summary

    Fields 
    Modifier and Type Field Description
    float saturationMultiplier  
    float targetHue  
    float targetSaturation  
    float valueModifier  
  • Constructor Summary

    Constructors 
    Constructor Description
    ColorizeFilter​(float r, float g, float b)
    Sets up a ColorizeFilter with the desired color to colorize towards.
    ColorizeFilter​(float r, float g, float b, float saturationMultiplier, float valueModifier)
    Sets up a ColorizeFilter with the desired color to colorize towards.
    ColorizeFilter​(com.badlogic.gdx.graphics.Color color)
    Sets up a ColorizeFilter with the desired color to colorize towards.
    ColorizeFilter​(com.badlogic.gdx.graphics.Color color, float saturationMultiplier, float valueModifier)
    Sets up a ColorizeFilter with the desired color to colorize towards.
  • Method Summary

    Modifier and Type Method Description
    com.badlogic.gdx.graphics.Color alter​(float r, float g, float b, float a)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ColorizeFilter

      public ColorizeFilter​(float r, float g, float b)
      Sets up a ColorizeFilter with the desired color to colorize towards.
      Parameters:
      r - the red component to colorize towards
      g - the green component to colorize towards
      b - the blue component to colorize towards
    • ColorizeFilter

      public ColorizeFilter​(com.badlogic.gdx.graphics.Color color)
      Sets up a ColorizeFilter with the desired color to colorize towards.
      Parameters:
      color - the Color to colorize towards
    • ColorizeFilter

      public ColorizeFilter​(float r, float g, float b, float saturationMultiplier, float valueModifier)
      Sets up a ColorizeFilter with the desired color to colorize towards.
      Parameters:
      r - the red component to colorize towards
      g - the green component to colorize towards
      b - the blue component to colorize towards
      saturationMultiplier - a multiplier to apply to the final color's saturation; may be greater than 1
      valueModifier - a modifier that affects the final brightness value of any color this alters; typically very small, such as in the -0.2f to 0.2f range
    • ColorizeFilter

      public ColorizeFilter​(com.badlogic.gdx.graphics.Color color, float saturationMultiplier, float valueModifier)
      Sets up a ColorizeFilter with the desired color to colorize towards.
      Parameters:
      color - the Color to colorize towards
      saturationMultiplier - a multiplier to apply to the final color's saturation; may be greater than 1
      valueModifier - a modifier that affects the final brightness value of any color this alters; typically very small, such as in the -0.2f to 0.2f range
  • 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>