Why do custom colors blow out?


mat.SetColor("_Color", new Color(219,219,219));

Does not work, on run time the rgb components blow out to 588889,588889,588889 and the object looks solid white. This happens when I try to set a custom color, but not if i use a predetermined color like Color.red

That’s because the 1 uses float values like inside the shader. The values are between 0.0 and 1.0

If you want to specify rgb values in byte range (0-255), use Color32. Color32 and Color are implicitly converted into each other, so they are compatible with any color value in unity.