Skip to content
项目

judah4/HSV-Color-Picker-Unity

在 GitHub 查看

关于

适用于 Unity UI 的 HSV 颜色选择器。

游戏与模拟器

这些数字如何统计

实测星标增长

24小时
-2
7天
-2
15天
-2
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

HSV Color Picker

openupm

HSV color picker using Unity UI. Unity Forum Thread

Versions

Unity 2020.3 LTS

Install

UPM

Follow the instructions on OpenUpm https://openupm.com/packages/com.judahperez.hsvcolorpicker/

{
    "scopedRegistries": [
        {
            "name": "package.openupm.com",
            "url": "https://package.openupm.com",
            "scopes": [
                "com.judahperez"
            ]
        }
    ],
    "dependencies": {
        "com.judahperez.hsvcolorpicker": "3.3.0"
    }
}

Unity Package

https://github.com/judah4/HSV-Color-Picker-Unity/releases

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.


using HSVPicker;
using UnityEngine;

public class SomeClass : MonoBehavior
{

	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;

resizable panels

Can be toggled and sized as needed in settings.

Setup Settings

settings inspector

On the color picker setup section.

Show Rgb: Show RGB sliders.

Show Hsv: Show HSV sliders.

Show Alpha: Show the alpha slider.

Show Color Box: Show the larger color selection box and color column.

Show Color Slider Toggle: Show the button to toggle the HSV and RGB sliders.

Show Header: Options to show the top header with color preview and hex code.

  • Hide: Hide the top header.
  • Show Color: Show only the color preview in the header.
  • Show Color Code: Show only the color code in the header.
  • Show All: Show the entire top header.

Color Presets

The prefabs starts with 4 colors in the color presets. This can be updated in the Setup section of the picker prefab.
Set the Preset Colors Id for different shared list between color pickers.

探索相关项目

加载中…