pvloon
August 23, 2015, 10:38am
1
Hey there,
5.1 introduced HDR fields, great, but referring to this thread:
http://forum.unity3d.com/threads/hdr-color-picker-in-normal-inspectors.327137/
We still can’t make HDR fields in the inspector. The documentation shows this config class being public:
Which is not true. I guess there were plans though, so I hope this issue can be fixed.
Best regards,
Arthur
BMayne
August 27, 2015, 12:55am
2
Hey there,
I am able to get access to this class it is indeed public. Here is a glimpse of the source,
Which version of Unity are you working with?
pvloon
August 27, 2015, 1:48pm
3
Huh I’m not sure what I checked that on - in 5.2.0f2 at least it’s indeed public. There also seems to be a method EditorGUILayout.ColorField which takes a bool hdr - hurrah!
…Only problem now is that EditorGUI.ColorField doesn’t have a public way to do HDR color fields… sigh.
Bug reported, case 722993
HDR colour pickers in the inspector can be added with the ColorUsageAttribute
In order to convert the color picker to HDR on a shader inspector, simply put [HDR] in front of the property. But this doesn’t work with a C# script. Do I have to create a custom inspector just for this or is there an easier way?
Reading time: 1 mins 🕑
Likes: 50 ❤
example:
[ColorUsageAttribute(true,true,0f,8f,0.125f,3f)]
public Color colour;
1 Like