Class HSL

java.lang.Object
games.stendhal.common.color.HSL

public class HSL extends Object
Methods for transforming between 32 bit ARGB and floating point HSL color spaces.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HSL()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    hsl2rgb​(float[] hsl, int[] rgb)
    Transform HSL color vector to ARGB space.
    static void
    rgb2hsl​(int[] rgb, float[] hsl)
    Transform ARGB color vector to HSL space.

    Methods inherited from class java.lang.Object

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

    • HSL

      public HSL()
  • Method Details

    • rgb2hsl

      public static void rgb2hsl(int[] rgb, float[] hsl)
      Transform ARGB color vector to HSL space. Transparency is dropped. All returned components are in range [0, 1].
      Parameters:
      rgb - red, green, blue value
      hsl - hue, saturation, lightness
    • hsl2rgb

      public static void hsl2rgb(float[] hsl, int[] rgb)
      Transform HSL color vector to ARGB space. Alpha is kept at 0 for everything. All HSL should be scaled to range [0, 1].
      Parameters:
      rgb - red, green, blue value
      hsl - hue, saturation, lightness