Package 

Class ColorHelper


  • 
    public class ColorHelper
    
                        

    Class with color helper functions. Please note the functions were copied over from: https://developer.android.com/reference/android/support/v4/graphics/ColorUtils (old support lib) https://developer.android.com/reference/kotlin/androidx/core/graphics/ColorUtils (new Androidx lib) Maybe include one lib directly.

    • Method Summary

      Modifier and Type Method Description
      static int HSLToColor(float h, float s, float l) Convert HSL to color value.
      static float constrain(float amount, float low, float high) Constrain float value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • HSLToColor

         static int HSLToColor(float h, float s, float l)

        Convert HSL to color value.

        Parameters:
        h - float h value form HSL color
        s - float s value form HSL color
        l - float l value form HSL color
      • constrain

         static float constrain(float amount, float low, float high)

        Constrain float value.

        Parameters:
        amount - input value
        low - lower bound
        high - upper bound