So I know the scripting reference has it listed out pretty simple, but it’s not working for me. I have the code:
yellowGoldfishColor = Color (255, 255, 255, 255);
But it assigns the color with rgba value of 255, 255, 0, 255 instead and gives 2 errors:
“Invalid normalized color: RGBA(150.000, 255.000, 0.000, 255.000), normalize value: 0
UnityEditor.DockArea:OnGUI()”
And
“Setting normalized color with a non-normalized color: RGBA(150.000, 255.000, 0.000, 255.000)
UnityEditor.DockArea:OnGUI()”
I don’t know what I’ve done wrong, am starting to wonder if the reference is wrong for 5.6?
Using Unity 5.6.0f3
Any help would be greatly appreciated!
EDIT: Result is always (150, 255, 0, 255) no matter what values I have in the code. Have also tried Color32 and that got rid of the errors, but problem still persisted.
We’re going to need to see the script it’s being used in then. Both Color and Color32 with integers and with floats are working for me in Unity 5.6.0f3. Here is the code I’m using to test it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Foo : MonoBehaviour {
private Color32 yellowGoldfishColor;
// Use this for initialization
void Start () {
yellowGoldfishColor = new Color(255, 255, 255, 255);
}
// Update is called once per frame
void Update () {
Debug.Log(yellowGoldfishColor);
}
}