allista / HSV-Color-Picker-Unity

HSV color picker using Unity UI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HSV Color Picker

HSV color picker using Unity UI

Versions

Unity 2018
Unity 2017
Unity 5.6
2018 is default, unity 5 and 2017 can import the assets just fine.

alt tag Should be really easy to use. Just add the prefab to the canvas, hook up an event, and it's good to go.

    public Renderer renderer;
	public ColorPicker picker;
     
	// Use this for initialization
	void Start ()
	{
		picker.onValueChanged.AddListener(color =>
		{
			renderer.material.color = color;
		});
		renderer.material.color = picker.CurrentColor;
	}
 
	// Update is called once per frame
	void Update () {
 
	}

if you want to assign your own color first, just do this call and it sets the slider and picker to the proper selection.

    Color color = Color.green;
    picker.CurrentColor = color;

About

HSV color picker using Unity UI

License:MIT License


Languages

Language:C# 98.0%Language:Smalltalk 2.0%