GUI color picker

hey any idea way it only seems to choose absolute colors?
I can only choose red, blue, green, yellow, magenta, turquoise, black and white. nothing in between?
also if i assign the color to my objects material it looks full bright, while assigning the same color in the inspector is shaded?

here is it in a web player:
http://www.therottchilds.com/web.html

#pragma strict

var myColor: Texture;

private var R:int;
private var G:int;
private var B:int;
private var color:Color;

function chooseColor()
{
	
	R = GUI.VerticalSlider(Rect (Screen.width-100, 60, 30, 100), R, 0, 255);
	G = GUI.VerticalSlider(Rect (Screen.width-70, 60, 30, 100), G, 0, 255);
	B = GUI.VerticalSlider(Rect (Screen.width-40, 60, 30, 100), B, 0, 255);
	GUI.Label(Rect(Screen.width-100, 160,30,30),"R");
	GUI.Label(Rect(Screen.width-70, 160,30,30),"G");
	GUI.Label(Rect(Screen.width-40, 160,30,30),"B");
	color =Color(R,G,B,1);
	GUI.color=color;
	print(color);
	GUI.DrawTexture(new Rect(Screen.width-100, 30, 75, 20), myColor);
	
}
function OnGUI ()
{
	chooseColor();
}

Have you considered that colors are not in the 0-255 range but in the 0-1 range? Divide it by 255 and see what happens.

Also hi Jister, you might remember me :slight_smile:

One thing you need to change is the int to float. Scripting the color r g b is a scale from 0.0 to 1.0. So your skipping the whole color scale.

hey thanks for the quick answers…
jessyDL are you the guy i use to make source mods with? :wink: what was the mod again… hitchhiker or the forgotten…?

any idea whats up with the full bright thingy? « looks like it solved itself by making the changes suggested :slight_smile:

Yup, years back :slight_smile:

There is a built in color picker (Editor GUI only)

Color newColor = EditorGUILayout.ColorField("Color tint", Color.white);

Only if this is an Editor script.