Interface GradientUtils.HueInterpolation

Enclosing class:
GradientUtils

public static interface GradientUtils.HueInterpolation
Hue interpolation modes. Since the hues form a color wheel, there are various strategies for moving from hue1 to hue2.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    HSV path always stays within the color wheel of raw values, never crossing the 360-degree boundary
    HSVCCW takes a counter-clockwise path always, even if it means a longer interpolation from hue1 to hue2, e.g.
    HSVCW takes a clockwise path always, even if it means a longer interpolation from hue1 to hue2, e.g.
    HSVM takes the minimum path from hue1 to hue2, wrapping around the 360-degree boundary if it makes for a shorter path
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    lerp(float hue1, float hue2, float lerp)
    Interpolate between two values
  • Field Details

    • HSV

      HSV path always stays within the color wheel of raw values, never crossing the 360-degree boundary
    • HSVM

      static final GradientUtils.HueInterpolation HSVM
      HSVM takes the minimum path from hue1 to hue2, wrapping around the 360-degree boundary if it makes for a shorter path
    • HSVCW

      static final GradientUtils.HueInterpolation HSVCW
      HSVCW takes a clockwise path always, even if it means a longer interpolation from hue1 to hue2, e.g. [350->340] will go [350->360],[0->340]
    • HSVCCW

      static final GradientUtils.HueInterpolation HSVCCW
      HSVCCW takes a counter-clockwise path always, even if it means a longer interpolation from hue1 to hue2, e.g. [340->350] will go [340->0],[360->350]
  • Method Details

    • lerp

      float lerp(float hue1, float hue2, float lerp)
      Interpolate between two values
      Parameters:
      hue1 - Source hue
      hue2 - Destination hue
      lerp - Interpolation amount
      Returns:
      A hue on a path between these two values