コード例 #1
0
        /// <summary>
        /// Gets the inverted HSB color.
        /// </summary>
        /// <param name="input">The color to invert.</param>
        /// <returns>An inverted HSB struct.</returns>
        public static HSB GetInverted(HSB input)
        {
            float hue = input.Hue;

            if (hue < 0.5f)
            {
                hue += 0.5f;
            }
            else
            {
                hue -= 0.5f;
            }

            return(new HSB(hue * 360, input.Saturation100, input.Brightness100, input.A));
        }
コード例 #2
0
 /// <summary>
 /// Inverts the current color.
 /// </summary>
 /// <returns>The inverted color.</returns>
 public HSB GetInverted()
 {
     return(HSB.GetInverted(this));
 }