Color Picker

Heya, Shaderheads!

What code would I use in a Shader script to have the property inspector display a clickable color picker for a float4?

You most likely wouldn’t write any shaders. You would just author a nice texture palette and then use GetPixel when the user clicks on the texture. If you want to be fancy you would generate the texture from code on the fly.

Good point, Joe, not in the Shader but in the calling script for it.

Also, I’m looking to do this in the editor, not at runtime.

So, I guess what I’m asking isn’t really a shader question per se, so much as a Javascript question.

That being said, is there a way that I can script a to put a click-on chicklet that brings up the system picker? Such as the Background Color parameter for a camera object does?

var	myColour : Color;

is that what you mean?

Cheers.