This is a simple color picker to be used in Unity.
Currently, it supports RGB, HSV, HSL and the HTML/hexadecimal codes.
All you have to do is download the latest NEO Color Picker .unitypackage from the Releases page and drag it into your project.
Note.: This includes NEO Utils 1.1.1 and may overwrite any previously installed version. If you want to use a more recent version of NEO Utils, install it after installing NEO Color Picker.
To add the color picker to a scene, just drag the Color Picker prefab (found in the Prefabs folder) into a Canvas. The color picker will appear white and without the slides in the Editor – that's fine, the sliders are created at runtime. You can easily modify the UI elements to suit your needs.
The ColorPicker class allows you to:
- Use
ColorRGB
,ColorHSL
andColorHSV
to get and set the currently selected color, using any model supported. Values are between 0 and 1. - Use
SetColorField
andGetColorField
to get and set a single color field (e.g. Hue) of the currently selected color. Values are between 0 and 1. - Use
CurrentModel
andAdvanceModel
to get, set or advance the color model (e.g. HSL) being used by the color picker. - Use
UsingAlphaSlider
to get and set the visibility of the alpha slider. - Add listeners to
onColorChanged
to automatically invoke them when the color picker's current color changes. This can also be done through the Inspector:
An example scene can be found in the Example folder.