예제 #1
0
    public void AssignColor(Color color)
    {
        var hsv = HSVUtil.ConvertRgbToHsv(color);

        // Debug.Log(hsv.ToString());

        float hOffset = (float)(hsv.H / 360);

        //if (hsv.S > 1)
        //{
        //    hsv.S %= 1f;
        //}
        //if (hsv.V > 1)
        //{
        //    hsv.V %= 1f;
        //}

        MovePointer(hOffset, false);
        MoveCursor((float)hsv.S, (float)hsv.V, false);

        currentColor     = color;
        colorImage.color = currentColor;

        onValueChanged.Invoke(currentColor);
    }
예제 #2
0
    private void RGBChanged()
    {
        HsvColor color = HSVUtil.ConvertRgbToHsv(CurrentColor);

        _hue        = color.normalizedH;
        _saturation = color.normalizedS;
        _brightness = color.normalizedV;
    }
예제 #3
0
    private void UpdateColor()
    {
        HsvColor hsv = HSVUtil.ConvertRgbToHsv(r, g, b);

        boxSlider.normalizedValue  = hsv.normalizedS;
        boxSlider.normalizedValueY = hsv.normalizedV;
        hueSlider.normalizedValue  = hsv.normalizedH;
        Color color = new Color(r, g, b, a);

        CurrentColor = color;
        UpdateUIData();
    }
    public void AssignColor(Color color)
    {
        var hsv = HSVUtil.ConvertRgbToHsv(color);

        float hOffset = (float)(hsv.H / 360);

        MovePointer(hOffset, false);
        MoveCursor((float)hsv.S, (float)hsv.V, false);

        currentColor     = color;
        colorImage.color = currentColor;

        onValueChanged.Invoke(currentColor);
    }