I want to select a color in the Unity editor, then set color values in code to make the corresponding Unity Editor color picker color become the GUIStyle color. Here's what I have for this peice:
public Color FontColor;
public int FontSize;
GUIStyle myStyle = new GUIStyle();
myStyle.fontSize = FontSize;
myStyle.normal.textColor = FontColor;
GUI.Label(new Rect(x * slotSize + stackAmountPosX, y * slotSize + stackAmountPosY, slotSize, slotSize), slotItem.amount.ToString(), myStyle);
So this should allow me to set the myStyle.normal.textColor to whatever I pick in the Unity Editor color picker. No matter what color I pick in the editor, it will not render the text, or even give me an error of some sort. I have spent time researching this, and haven't found any relevant answers.
EDIT: For further clarity: I AM NOT CREATING MY OWN COLOR PICKER. I am using Unity 5.0.1f1 64-bit. Perhaps my question was not very clear. I am creating my OWN script, that when attached to a GameObject should allow me to choose a color in the inspector using the Unity Color Picker to assign a variable to a certain color that I can then use to set the color of my text. The color picker works. My script works. But for some reason, Unity does not render the text using the FontColor variable. It only renders if I do Color.Black. It does NOT render if I use the FontColor variable and choose a Color (eg black) from the Unity Color Picker in the Inspector.
EDIT: Since apparently I don't have enough reputation (I need to read up on the system of reputation), I will describe the image. It's a picture of Unity's color picker in the inspector with my variable assigned to it.
The above picture is the color picker available in the Inspector when using the FontColor variable. I choose the color from this color picker, and it does not render the text. It will only render the text if I set the color directly, and not throught a variable.