Colors Seem all wrong when I set them in RGB

So I set a color = new Color(10,40,90); thinking I’m going to get a dark blue but I get a bright white.

Pretty much I seem limited to only the colors that can be found doing color.red or w/e

Whats going on here?

Color in unity are expressed as floats in the range of 0.0 to 1.0. So your blue color would approximately be

color = new Color(.04f, .16f, .35f);

Alternatively you can now also use the “Color32” struct which represents an RGBA value that consists of 4 byte values in the range of 0 - 255. Color and Color32 have implicit casting operators so they are automatically converted into each other.

// C#
Color someColorVar;

// somewhere else:
someColorVar = new Color32(10, 40, 90, 255);

Here the Color32 is implicitly converted into a Color.

Unforunately “Color32” doesn’t have an additional constructor that takes only 3 values as “Color” has. So you always have to explicitly specify the alpha value. However you can directly use byte values