SetColor() public method

Sets the selected color.
public SetColor ( Color value, bool onlyHue = true ) : void
value Color Value to set.
onlyHue bool Deetrmines whether to only set H value (not SV).
return void
Example #1
0
        /// <summary>
        /// Sets the selected color.
        /// </summary>
        /// <param name="color">Color to set.</param>
        /// <param name="onlyHue">Determines whether only the hue should be set.</param>
        /// <param name="reset">Determines whether the "before" color should be set as well.</param>
        public void SetColor(Color color, bool onlyHue = false, bool reset = false)
        {
            UpdateControls(color);

            if (reset)
            {
                m_Before.Color = color;
            }

            m_ColorSlider.SelectedColor = color;
            m_LerpBox.SetColor(color, onlyHue);
            m_After.Color = color;
        }
Example #2
0
        public void TestColorLerpBox()
        {
            var control = new ColorLerpBox(canvas);
            control.SetColor(Color.NavyBlue);

            GUI.Test(control, "ColorLerpBox1");
        }