Exemple #1
0
 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     if (colorField != null)
     {
         colorField.Hue           = HSBColor.GetHue(control.Color);
         colorField.SelectedColor = control.Color;
     }
 }
Exemple #2
0
    public void Start()
    {
        // Obtain a reference to the dfTextureSprite instance attached to this object
        this.control = GetComponent <dfTextureSprite>();

        this.hue   = HSBColor.GetHue(control.Color);
        this.color = control.Color;

        updateHotspot();
    }
    public void OnTextSubmitted(dfControl control, string value)
    {
        uint result = 0;

        if (uint.TryParse(value, NumberStyles.HexNumber, null, out result))
        {
            var color = UIntToColor(result);

            colorField.Hue           = HSBColor.GetHue(color);
            colorField.SelectedColor = color;
        }
    }
Exemple #4
0
    public void OnValueChanged(dfControl source, float value)
    {
        if (!container.ContainsFocus)
        {
            return;
        }

        this.color = new Color(redSlider.Value, greenSlider.Value, blueSlider.Value);

        colorField.Hue           = this.hue = HSBColor.GetHue(color);
        colorField.SelectedColor = color;
    }