Class HSLColor


  • public class HSLColor
    extends Object
    Support class for color functions, represents a color in HSL space (based on http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/)
    Author:
    Andrea Aime - GeoSolutions
    • Constructor Summary

      Constructors 
      Constructor Description
      HSLColor​(double hue, double saturation, double lightness)
      Builds a color based on HSLA components
      HSLColor​(double hue, double saturation, double lightness, double alpha)
      Builds a color based on HSLA components
      HSLColor​(Color color)
      Builds the HSL representation of a color
    • Constructor Detail

      • HSLColor

        public HSLColor​(double hue,
                        double saturation,
                        double lightness)
        Builds a color based on HSLA components
      • HSLColor

        public HSLColor​(double hue,
                        double saturation,
                        double lightness,
                        double alpha)
        Builds a color based on HSLA components
      • HSLColor

        public HSLColor​(Color color)
        Builds the HSL representation of a color
    • Method Detail

      • setHue

        public void setHue​(double hue)
      • setSaturation

        public void setSaturation​(double saturation)
      • setLightness

        public void setLightness​(double lightness)
      • setAlpha

        public void setAlpha​(double alpha)
      • getHue

        public double getHue()
      • getSaturation

        public double getSaturation()
      • getLightness

        public double getLightness()
      • getAlpha

        public double getAlpha()
      • toRGB

        public Color toRGB()
        Turns the HSL representation into a RGB one
      • toString

        public String toString()
        Overrides:
        toString in class Object