コード例 #1
0
        /// <summary>
        /// Transforms a RGB into color into the corresponding hue, brightness and saturation
        /// parameters for the Hue light.
        /// </summary>
        /// <param name="color">Color.</param>
        /// <param name="hue">Hue.</param>
        /// <param name="saturation">Saturation.</param>
        /// <param name="brightness">Brightness.</param>
        public static void ColorValues(Color color, out int hue, out int saturation, out int brightness)
        {
            Vector3 hsv = HueLight.HueHSVfromRGB(color);

            hue        = Mathf.RoundToInt(hsv.x);
            saturation = Mathf.RoundToInt(hsv.y);
            brightness = Mathf.RoundToInt(hsv.z);
        }