Enum ColorInterpolation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ColorInterpolation>

    public enum ColorInterpolation
    extends java.lang.Enum<ColorInterpolation>
    Color interpolation
    Since:
    0.8.0
    Author:
    Robert Gehde
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      HSV
      ColorInterpolation in HSV space.
      RGB
      ColorInterpolation in RGB space
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ColorInterpolation()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String interpolate​(java.lang.String color, java.lang.String neutral, double intensity)
      Interpolate two colors.
      static ColorInterpolation valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ColorInterpolation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • HSV

        public static final ColorInterpolation HSV
        ColorInterpolation in HSV space.

        note: this changes the tone linear as well, if you use a black color, black is coded as (0,0,x). In that case it will change the color.

    • Constructor Detail

      • ColorInterpolation

        private ColorInterpolation()
    • Method Detail

      • values

        public static ColorInterpolation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ColorInterpolation c : ColorInterpolation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ColorInterpolation valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • interpolate

        public abstract java.lang.String interpolate​(java.lang.String color,
                                                     java.lang.String neutral,
                                                     double intensity)
        Interpolate two colors.
        Parameters:
        color -
        neutral -
        intensity -
        Returns:
        interpolated color