예제 #1
0
        public static Color HSL2RGB(ColorHSL hsl)
        {
            float a = hsl.s * Mathf.Min(hsl.l, 1 - hsl.l);

            float Component(int n)
            {
                float k = (n + hsl.h * 12) % 12;

                return(hsl.l - a * Mathf.Max(-1, Mathf.Min(k - 3, Mathf.Min(9 - k, 1))));
            }

            return(new Color(Component(0), Component(8), Component(4), hsl.a));
        }
예제 #2
0
 public bool Equals(ColorHSL other)
 {
     return(this.h.Equals(other.h) && this.s.Equals(other.s) && this.v.Equals(other.l) && this.a.Equals(other.a));
 }